| | |
Pausing program with getchar();
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Nov 2006
Posts: 37
Reputation:
Solved Threads: 0
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");
c = getchar();
Is there another way to pause the program with C, without using system("PAUSE");
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
The program will not stop if there are still keystroks in the keyboard buffer, such as if you previously called scanf() to get an integer the '\n' will still be in the keyboard buffer. But you will have to post your program for anyone to give you more help with this.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
The 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 what each input function does.
I'm here to prove you wrong.
•
•
Join Date: Nov 2006
Posts: 37
Reputation:
Solved Threads: 0
Pelles C. Its a good IDE, similar to Dev C++. I don't know how to convert from type to another anyways...
Last edited by Firestone; Jul 13th, 2007 at 5:57 pm. Reason: Typo
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
There are 10 types of people in the world,
Those who understand binary, and those who don't
=================================
![]() |
Similar Threads
- Error in simple "Hello World" program (C++)
- Help needed asap (C)
- Factorial of a number (C)
- Graphics in C (C)
Other Threads in the C Forum
- Previous Thread: Reverse print
- Next Thread: How to uderstand a make file
| Thread Tools | Search this Thread |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators initialization iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql odf open opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling scripting segmentationfault send shape socketprograming socketprogramming stack standard string suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h






