Hey guys, I made this simple code, along with many others and cannot seem to
get it to run. I press "Compile and run" and it seems to just compile forever,
it never runs it... just keeps compiling, I cannot even cancel it with the
cancel button. I dont know what up, tried re installing many times now.
This problem does compile. What I did is I clicked "Compile and Run" and it
compiled and the executable file saved on my desktop. When I went into it, I
noticed that the program ran for only about a millisecond. Then, I realized
the error.
You need to add system ("PAUSE"); somewhere in your program, so that the
screen does not close right away.
Try this:
//game over
include <iostream>
int main() {
std::cout << "Game over!" << std::endl;
return 0;
system ("PAUSE");
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey guys, I made this simple code, along with many others and cannot seem to
get it to run. I press "Compile and run" and it seems to just compile forever,
it never runs it... just keeps compiling, I cannot even cancel it with the
cancel button. I dont know what up, tried re installing many times now.
Here is my code... basic stuff
I am using dev cpp 4.9.9.2
Thanks for the help,
Dan.
//game over
include <iostream>
int main() {
std::cout << "Game over!" << std::endl;
return 0;
}
Hi, Dan.
This problem does compile. What I did is I clicked "Compile and Run" and it
compiled and the executable file saved on my desktop. When I went into it, I
noticed that the program ran for only about a millisecond. Then, I realized
the error.
You need to add system ("PAUSE"); somewhere in your program, so that the
screen does not close right away.
Try this:
//game over
include <iostream>
int main() {
std::cout << "Game over!" << std::endl;
return 0;
system ("PAUSE");
}