"Find the errors" hw question

This is a "find the errors" assignment from a textbook; the textbook gives the answer to the question as "The isupper function can only be used to test a character, not a string." I understand that; but how would you split the string up into individual characters to test?

1
2
3
char str[] = "Stop";
if (isupper(str) == "STOP")
    exit(0);
With a loop. A C-string is a merely an array (of characters) that has value 0 in its last element.
Topic archived. No new replies allowed.