c++ - How to keep looping until non-integer is entered -
i have program trying keep looping until entered non-integer. no matter if enter non-integer or integer program still breaks , end. please help
int data; { cout<<"enter data: "; cin>>data; cout<<"yes"<<endl; return data; } while(cin.good());
remove return
(or write after while) break code before while line...
Comments
Post a Comment