Hello,
I'm trying to make my code work with -Wall -Werror flags but I get the above error (error: array subscript has type char). Here is the code, which works if these flags are not set. The code is meant to check whether the first character from text is blank or not.
void processText(char *text, int *position) {
if (isblank(text[0])) { // error: array subscript has type char
*position = *position + 1;
text = text + 1;
processText(text, position);
}
}
I've tried
isblank(atoi(&letter[0]))
and
isblank(text[0]- '0')
. They do allow it to compile with no errors under -Wall -Werror flags but the result is completely different which probably means the conversion isn't correct.
Any help is appreciated :icon_cheesygrin:
Thanks