Could anybody tell me how to clear the input buffer in C (what is the command for it)?
I would look it up my self but I don't have any book on C and when I tried googleing I couldn't find the answer.
Thanks in advance,
Valheru.
Printable View
Could anybody tell me how to clear the input buffer in C (what is the command for it)?
I would look it up my self but I don't have any book on C and when I tried googleing I couldn't find the answer.
Thanks in advance,
Valheru.
I think what you're looking for is:
fflush(stdin);
You have to (I think) #include <stdlib.h> for it.
Cheers,
cgkanchi
That was exactly what I was looking for.
Thank you very very much. (My program is now working properly :D )
Valheru
Try using functions of <io.h> , <dos.h>
Here is a free Teach Yourself C in 21 Days online book . It makes for a great reference ;)