Computer Forums

Computer Forums (
-   Programming (
-   -   Dev C++ help (

Syn7ax 3rror 04-02-2005 11:47 PM

Dev C++ help
Hello all. i just installed Dev C++ and tried to compile a program. But, when I hit "run", a window just flashed up for a milisecond then went away. Please tell me what I am doing wrong. It linked and compiled correctly and has no bugs.

UK31337 04-03-2005 07:55 AM

Chances are you're not doing anything wrong.

Add the following line to the end of your program:


Put it just before the final closing brace in int main()

You'll then see your window stay open and it'll say "Press any key to continue..." instead of just exiting.

To get around this problem without that extra code, just open up Command Prompt, navigate to the directory that contains your exe, and run it from there. The window won't close after you run the program.

Syn7ax 3rror 04-03-2005 11:20 AM

Ahhhh. Thanks alot. If I want to open the cursor, where is it located.

Syn7ax 3rror 04-03-2005 11:55 AM

Ok heres what I got


#include <iostream>

int main()
std::cout << "Hello World/n;"
;return 0;


But when I complie it says done but when I hit run it syas "Project not compiled. I did a compile and run in one step and the cursor still flashed. Please help.

UK31337 04-03-2005 04:13 PM

I've changed your code as follows:


#include <iostream>

int main()
std::cout << "Hello World\n";
return 0;

What I've put up there works perfectly for me. Make sure return 0; is the final statement (I was wrong earlier about system("pause"); being the last).

Note the ; comes at the end of the lines, not at the end of the text string.

Any more problems, feel free to let me know.

Syn7ax 3rror 04-03-2005 05:14 PM

Ahhh. Tha's rite. Thanks!

All times are GMT -5. The time now is 12:26 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0