The problem with the input and output stream has not been clear.
Do OJ today, involving the input of strings
Here are three types of buffer cleanup issues
Law One:
Fflush (stdio);
View Code
According to Baidu experience, this usage applies only to the VC6.0 version
Law II
Setbuf (Stdio,null);
View Code
The second method is to set the standard input stream to an empty buffer
Fahsarm
Chartemp;//The wording of a while(temp = GetChar ()! ='\ n'&&temp!=EOF)//notation Two while(1) {Temp=GetChar (); if(temp=='\ n'|| temp=='EOF') Break;}
View Code
This approach is to use a loop that always reads the characters in the buffer
Written in two ways.
The first one is cool, but it's very eye-reading.
The second is simple and straightforward, I prefer the second kind
--------------------------------------------------------------------------------
This is my first technical blog, although very irregular, but everything at the beginning of the difficult, this should be a freshman should understand things, now a senior to solve, ashamed.
It looks like the experience of Baidu, but it is summed up once, it is always good.
About the specific parameters of each function, call, I should go to read a technical document, to a good summary of, but prepare for the second-round interview, Time Rush, after the empty again to complement the full of robustness.
About the cleanup of C-language buffers