Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

deal with bad input cpp

catch (std::ios_base::failure& e)
{
	std::cin.clear(); //clear bad input flag
	std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '
'); //discard input
	printf(InputException().what());
}
 
PREVIOUS NEXT
Tagged: #deal #bad #input #cpp
ADD COMMENT
Topic
Name
2+1 =