The semicolon was there, I must have missed it when I copied the code.
Theres actually around 10 more lines of code in the loop before the variable is assigned, and when I use i on it's own, the whole block fails to work:(
Theres actually around 10 more lines of code in the loop before the variable is assigned, and when I use i on it's own, the whole block fails to work:(
So, show the whole block. There is clearly a problem with the code that needs to be addressed, not masked.
This loop will execute when t is 0, 1, 2, 3, 4, 5, and 6. That's 7 values.
char startArr[6]
Oops. Not enough room (and no space for the trailing NULL).
if(strcmp(startArr, ":Start:")
The str functions operate on strings, not character arrays. The difference between a character array and a string is that a string is a character array THAT IS NULL TERMINATED. startArr is NOT NULL-terminated.
For some reason, the strcmp was working fine. And also before changing the char array sizes, but some other things, my initial problem has gone away. I was forgetting about this and modifying other code and then came back and tried the original variable declaration and it worked.