I am using a book to learn C++. I wrote the code that does a "Hello World" statement, and when I click "Compile" nothing happens. I am using DevC++.
I have a problem compiling a simple "Hello World" Statement
Collapse
X
-
Tags: None
-
Were there any compiler errors? If so, what are they? If not, are you sure the program didn't close before you were able to see its output?
A crude way to keep the window open is to use getchar.
Another idea would be to check in the project folder and see if you've got an executable; if you do, trying running it from the command line.Code:// your code getchar(); return 0; }
-
-
use getch() just before return statement of main().
or use system("PAUSE") likeCode:main() { //your code getch(); return; }
Code:main() { //your code system("PAUSE");//note pause is written in capital letters return; }Comment
Comment