Jan 24 - } Moreinput = true; While(moreinput){...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Jan 24, 2006, ECE106 C++ I/O If(cin.fail()){ Cout<<”bad input”<<endl; Exit(-1); } Repeat=true; While(repeat){ Cin>>x; If(cin.fail()){ Cout<<”Bad input, try again”<<endl; Cin.clear(); Cin.ignore(1000,’ \n’); } else Repeat=false;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } Moreinput = true; While(moreinput){ Cin&gt;&gt;x; If(cin.fail()){ If(cin.eof()){ Moreinput = false; } Else{ Cin.clear(); Cin.ignore(10000, \n); Moreinput=true; } } Else{ ;} //hapy }...
View Full Document

Page1 / 2

Jan 24 - } Moreinput = true; While(moreinput){...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online