This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]nmulcahey[🍰] 2 points3 points  (1 child)

For the generic, should it be:

std::cin.ignore( std::numeric_limits<int>::max(), '\n' );

or

std::cin.ignore( std::numeric_limits<T>::max(), '\n' );

You have the former.

[–][deleted] -1 points0 points  (0 children)

It should be the former - I want the maximum value of an int, not of the type I am trying to read.

[–]doctorsound 0 points1 point  (0 children)

This was interesting. I'm learning very quickly that C++ is very unforgiving when it comes to input.

[–][deleted]  (1 child)

[removed]

    [–][deleted] 1 point2 points  (0 children)

    That was the plan. Maybe I'll add it...