• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Dev C++

laziassazn

New Member
Joined
Apr 15, 2009
Messages
11 (0.00/day)
So im trying to do some C using Dev C++ i can compile everything fine but when I run the program for instance hello world the screen with my results will only flash for like half a second.

Any thoughts?
 

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
26,259 (4.64/day)
Location
IA, USA
System Name BY-2021
Processor AMD Ryzen 7 5800X (65w eco profile)
Motherboard MSI B550 Gaming Plus
Cooling Scythe Mugen (rev 5)
Memory 2 x Kingston HyperX DDR4-3200 32 GiB
Video Card(s) AMD Radeon RX 7900 XT
Storage Samsung 980 Pro, Seagate Exos X20 TB 7200 RPM
Display(s) Nixeus NX-EDG274K (3840x2160@144 DP) + Samsung SyncMaster 906BW (1440x900@60 HDMI-DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay + USB 3.2 (A+C) 3.5" bay
Audio Device(s) Realtek ALC1150, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse Nixeus REVEL-X
Keyboard Tesoro Excalibur
Software Windows 10 Home 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
You have to read input in order to make it hold in a console. Or you run it via command console/kernel which will keep the output on screen.
 
Joined
Feb 11, 2008
Messages
607 (0.10/day)
Location
Omaha, Nebraska, USA
System Name Built By Me
Processor Intel Core i9 9900K @ 5.1 GHz
Motherboard Gigabyte Z390 Aorus Ultra
Cooling Custom Water Cooling - CPU Only
Memory 32GB (2 x 16) GSkill Ripjaws V DDR4
Video Card(s) RTX 4080 - ASUS ROG Strix 16GB OC - P Mode
Storage 1TB Samsung 970 Evo NVMe
Display(s) Alienware AW2723DF @ 280 Hz @ 1440P
Case Fractal Design Define S2
Audio Device(s) Corsair Virtuoso Pro
Power Supply 850W Seasonic Platinum
Mouse Razer Viper V2 Pro @ 2k Hz
Keyboard Asus ROG Strix Scope II 96 Wireless - ROG NX Snow Switches
Software Windows 11 Pro
You can either use the following commands before the end of the code so that the output will pause:

cin >> "already declared variable";

or if you feel like unnecessarily using more memory try,

system("pause");
 

james2008

New Member
Joined
Sep 4, 2009
Messages
29 (0.01/day)
This happens because the console runs the command and automatically closes
it after finishing. You can either hard code a pause into your program, which is a
good idea. Or tell it through right click and the options, which isn't a good idea!

I alway use the getchar(); command and some kind of messsage,
cout << "press key!" <<endl; (obv beforehand!)

I don't use the cin command, because it doesn't except enter
and such like keystrokes!
James
 
Last edited:

mickyching

New Member
Joined
Oct 22, 2009
Messages
7 (0.00/day)
linking error How to solve it?

Hello Everyone,

I need help.I have some linking error in my c++ program.
I am working on c++ on Linux.I have included all need header files required.
But there is a problem of linking error.
How to solve it?

Can anyone help me out??How to solve this linking error?
 
Top