Answer the question
In order to leave comments, you need to log in
Threads: How is cin.goodbit different from cin.good()?
Good evening, I'm trying to understand threads and the i/o library
What is different about this code:
int i;
cin » i;
auto flag = cin.rdstate();
if (flag == cin.goodbit) cout « "Все в порядке!"; //если ввести целочисленное значение
cin.clear()
int i;
cin » i;
if (cin.good()) cout « "Все в порядке!"; //если ввести целочисленное значение
cin.clear()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question