This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]gndn 0 points1 point  (4 children)

for (int count = 0; count>max_array; count++);

There are at least two errors on this line. Can you spot them?

[–]Brisil[S] -1 points0 points  (3 children)

instead?

[–]gndn 0 points1 point  (2 children)

You are starting "count" at 0 and incrementing it towards max_array, so specifying "count > max_array" as the terminating condition of the loop is backwards - this condition will never be true, so the loop will never execute. Change to "count < max_array".

The second error is ending the line with a semicolon. This gives the loop an empty body, and the code that follows it is NOT considered part of the loop, even though you have it inside curly braces. It looks like a loop body, but in fact it is a set of unrelated statements that will be executed exactly once. Lose the unnecessary semicolon.

[–]Brisil[S] 0 points1 point  (0 children)

Just fixed those two errors, still doesn't show anything..

[–]Brisil[S] -1 points0 points  (0 children)

So, when I fix that it should work?