command line isalpha check

how does one go about checking multiple segments of an argument, i can get it to work with the initial but anything after that i start getting false cout

so for each argument id like it to check up to 5 inputs
thus going through argv[1][0], argv[1][1], argv[1][2] etc

im sure its something simple, but its driving me bonkers


1
2
3
4
5
if (isalpha(argv[1][0]))
		{
			cout << "Char Error ";
			return (0);
		}
I would write a "for" loop that placed each argument into a string. Then I would iterate over the string character-by-character and call "isalpha()" in this case for each character.
Topic archived. No new replies allowed.