nonpuz:
It's ok, we all have those days - That's why they put an eraser on the back of pencils.
I try to avoid
* Posting a fact that I can't find a source for .
* Posting code that has not been...
Type: Posts; User: Click_here
nonpuz:
It's ok, we all have those days - That's why they put an eraser on the back of pencils.
I try to avoid
* Posting a fact that I can't find a source for .
* Posting code that has not been...
I ran the OP's code where I confirmed that (in the word of the OP)
What do you think happens to the data on stdin when scanf fails?...
3 - Yes. When I ran my code with the while loop removing...
Have you ran my code...
... I bet that you haven't ...
There are a few similarities between scanf and sscanf...
Clear stdin on the event of a fail and your code will work fine.
Here is a short bit of code that demonstrates the problem
#include <stdio.h>
#include <stdlib.h>