0

I am receiving the error: expected expression with this line of code.

if(char* i in (word[i]) isalpha) {

I need to iterate over the characters[i] in a word entered by the user. First I need to check that each letter is a character.

I have modified this code in many ways, including putting isalpha first inside the brackets but always receive an error.

I have tried defining char word before the 'if' statement commences but this hasn't worked either.

I am also confused about the reason why some people use the * with char and others not. I hope someone can assist me.

1

I guess you mean if (isalpha(word[i])), with word being a char[] or char*, and i being something like an int? Could you maybe clarify your question by adding the surrounding code to your question?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .