I'm trying to perform a simple input operation, and check to make sure that whatever the user input is a valid input (is within data type bounds, is correct data type...). But when I get to ignoring the input, I keep getting an error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
unsignedshort num;
while (true)
{
std::cin >> num;
if (std::cin.fail())
{
num = 1;
std::cout << "Error" << std::endl;
std::cin.clear();
std::cin.ignore(std::numeric_limits<unsignedshort>::max/*Error: expected an identifier*/(), '\n');
}
}
I don't fully understand why this error is here. I'm writing things just as they are on the tutorial.
If someone could help me out, that would be much appreciated.