Question:
DEV C++ Compiler Question??
Bob R.
2008-06-12 16:24:08 UTC
Okay, so I'm a super beginner at Computer Science. I downloaded the 4.9.9.2 version of the DEV C++ compiler today, but when I put a simple program in, namely:

#include

main()
{
printf("This is a C program\n");
}

, it doesn't execute when I click compile and run. A black box flashes on the screen and disappears when I click this, however. Can someone help me? >.<
Four answers:
PhpMyCoder
2008-06-12 16:28:57 UTC
Interestingly enough the same problem happens to me. It is because you haven't told the system to pause and let the user read the output. I an not that fluent in C++ so you would have to consult a C++ coder for help on pausing. It is something like:

system("Pause");
empormike
2008-06-12 16:28:19 UTC
It probably is working. That black box _is_ the program, but it only opens really quick to execute and then closes. Go to your Command Prompt and go to the directory that you have your file and open it through that.
tong21186
2008-06-12 16:30:51 UTC
#include



main()

{

printf("This is a C program\n");

system("pause");

return 0;

}



this will pause the screen and stop it from disappearing
?
2016-10-17 07:01:14 UTC
gadget is working an OS command called 'Pause'. i think of gadget might desire to be in stdlib.h. attempt which contain that. yet extra importantly, is there a command called 'Pause' on your laptop that your C++ application can run?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...