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.
Code:// your code getchar(); return 0; }
-
-
use getch() just before return statement of main().
Code:main() { //your code getch(); return; }
Code:main() { //your code system("PAUSE");//note pause is written in capital letters return; }
Comment
Comment