How to do a parsing?

Hi guys. I'm a university student and I have a final project that need a parsing method. I have to check if there is any alphabet in the input. If there is, even only one, there should be an error message and it should be back at the question.
Example:
Q:How many semesters do you want?
A:1A
It should be error because there is an alphabet in the input.

If you know how to do it, please post here. Give me an example and describe the syntax that are used. Thanks before...
Last edited on
Just use a stringstream, then you can check each character individually using isalpha() [checks if a char is a-z A-Z or not].
Topic archived. No new replies allowed.