My compiler won't pause on getchar();. I have Dev C++ 4.9.9.2 and if I put getchar(); at the end of the program, it doesn't stop, and the console window still exits. It still exits when I assign a variable to it
c = getchar();
Is there another way to pause the program with C, without using system("PAUSE");
Firestone 0 Light Poster
Recommended Answers
Jump to Post>Is there another way to pause the program with C, without using system("PAUSE");
Sure. Don't run your program in an IDE that isn't smart enough to keep the window open. Run it from the command prompt.
Jump to PostThe problem arises when you don't know how C uses stream based input. You can mix input methods without any trouble if you know what happens, but most people just make function calls without knowing what's going on. The ideal fix is to learn how stream I/O works and learn …
Jump to Post>but my way is best
No, your way promotes ignorance. Mine promotes learning.>safer (for newbies )
Trading one mystery for another isn't safer.>and works
Which is why I didn't immediately correct you.
All 12 Replies
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Narue 5,707 Bad Cop Team Colleague

iamthwee
Narue 5,707 Bad Cop Team Colleague

iamthwee
Firestone 0 Light Poster
Narue 5,707 Bad Cop Team Colleague

iamthwee
Firestone 0 Light Poster

iamthwee
ayarosh 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.