-
simple question
I'm using K&R C code and the Dev-C compiler. I'm making a DOS console and used this code.....
#include <stdio.h>
int main(int argc, char *argv[])
{
printf( "Hello, people\n" );
}
The program executes but closes after it displays the message, any one know how I keep the program open ?
Many Thanks
-
Various methods. One is adding something to keep the window open, like system("pause") (you need <stdlib.h> for that). I don't like them.
I prefer opening a console window and call the app from there.
-
Oh, and by the way: you're in the wrong forum. This is the C# forum, the C/C++ forum is further down the index page.
-
i dont understand why ppl who work in c++ can confuse '++' word to '#', and if in play c to now to know that c++ and C# arent the same as c...........something's very wrong
-
I know the difference between the two c++ is object orientated. I also didn't see the other C forum, I never confused this one with it, so I thought the people in this forum might have the answer (which they did), chow
-
you can do a
getchar();
which will wait until Enter is pressed.
-
Except that I mainly visit the C/C++ forum, so I'm not one of the people from here really. :)