0
 if ((word{i} >= 'a' && word{i} <= 'z') || (word{i} >= 'A' && word{i} <= 'Z'))
    {
        while (points{j} < word{i})
        {
            j++;
        }
        total += points{j}
    } 

The error happens on the first line of the code. The complier wants me to put a parentheses around the "word" at the beginning of the if statement. But if I do that, the whole array will be messed up. I'm wondering why it won't accept my if statement and what I could do to fix it. Thank you!

1 Answer 1

0

If you want to index into a char array or a string, you must use [ and ] instead of { and }.

Also, the line

total += points{j}

is missing a ; at the end.

You must log in to answer this question.

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