|
-
Apr 23rd, 2003, 08:44 PM
#1
Thread Starter
Lively Member
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
"I love the silence before the storm it reminds me of Beethoven"
-
Apr 24th, 2003, 05:51 AM
#2
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 24th, 2003, 05:52 AM
#3
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 24th, 2003, 10:20 AM
#4
yay gay
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
\m/  \m/
-
Apr 24th, 2003, 10:56 AM
#5
Thread Starter
Lively Member
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
"I love the silence before the storm it reminds me of Beethoven"
-
Apr 24th, 2003, 11:29 AM
#6
Member
you can do a
getchar();
which will wait until Enter is pressed.
-
Apr 24th, 2003, 12:07 PM
#7
Except that I mainly visit the C/C++ forum, so I'm not one of the people from here really.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|