If you read the prevous post you see that what I posted using
while ((ch[0] std::cin.get) != '\n') { if (isdigit(ch[0])) ....etc }
True, but the code in it's entirety is too complicated and hard to follow by creating essanitally a 1-character string and the use of strtol()
instead of a simple subtraction.
IOW, it's not a good example. Sorry, it's confusing.