what Example: Or do I have to use cin.get ()? Example: Will these codes give the same results? Ah, stupid me, I made a function to make clearing calls And in my program, it is called the function I'm guessing this, cin.ignore (100, '\ n') works Will the use of cin through stream?
cin> & Gt; Temporary; // Enter the key input if (cin.fail ()) {cin.clear (); Cin.ignore (100, '\ n'); }
temp = cin.get (); If (cin.fail ()) {cin.clear (); Cin.ignore (100, '\ n'); }
Zero clear () {cin.clear (); Cin.ignore (100, '\ n'); }
clear () more than once in those cases where
clear () It was called twice in the row without input from the angle, it was prompted for input in a blank line.
Comments
Post a Comment