how to check integer in character

Hi

I need help in my project in which i have to convert arabic numbers to roman and roman to arabic .i have finished it but i have to look if e.x user puts a number 123M which must not be accepted or in other hand e.x MMLDX123 or MMK.
So i have to check if there exists an integer in character or unaccepted letter or in other hand if there exists an character in integer.

Thanks for your attention.
Your help will save an man Head:P:P
Most on here will tell you to post what you already have, but I'll go ahead and give you a hint.

1
2
3
4
5
char ch;
do{          
          cin >> ch;
    }while (isalpha(ch) );

Will loop prompting the user so long he enters a character. I forget what header file you have to include, just google isalpha().
Last edited on
It's <cctype>

-Albatross
You may try traverse your string array and check every char using the trick by wtf.

Hope this help you.
Topic archived. No new replies allowed.