0
int wordsize = atoi(argv[1]);
int status[wordsize];

for (int b = 0, wordsize < b; b++)
{
    status[b] = 0;
}

The error happens specifically at the word "wordsize" in the for loop. I'm pretty confused, because it's saying i'm making a second declaration when I'm not sure how. The purpose of the code is to turn the users score or "status" at the beginning of the game into 0, because it just started.

1 Answer 1

0

This looks like a typo to me. Look carefully at the for statement:

 for (int b = 0, wordsize < b; b++)

It declares both b and wordsize as int types. It also only has two clauses, not the required three.

I'm guessing that the comma should be a semicolon and that wordsize < b is the test condition, not a declaration.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

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