questions regarding ignore and clear

hi
my question is same as title

eg:
1
2
3
4
cout << "enter an integer: ";
cin >> integer;

cin.ignore();


how does cin.ignore() worked??
and how does cin.clear() function??
cin.ignore() will ignore one character in the stream (and discard it).

cin.clear() will clear the stream of all data and clear the error flags.
closed account (z05DSL3A)
cin.ingnore(): http://www.cplusplus.com/reference/iostream/istream/ignore/
cin.clear(): http://www.cplusplus.com/reference/iostream/ios/clear/
Just search on cplusplus.com
ok ok
thanks
now i understand what ignore and clear means
thanks guys
Topic archived. No new replies allowed.