I have the following code
FRAME frameArray[5][10]; // Create the array of frames
int trackBufferFull[5] = {0, 0, 0, 0, 0};// Keeps track of how full the buffer f
Line 77 is the line
trackTail[nodeNumber-1] = ++trackTail[nodeNumber-1] % 10;
You are changing trackTail[nodeNumber-1]
twice between sequence points: once through ++
, and once through assignment.
This is undefined behaviour.
The remedy is to rephrase the statement, for example like so:
trackTail[nodeNumber-1] = (trackTail[nodeNumber-1] + 1) % 10;
or like so:
trackTail[nodeNumber-1]++;
trackTail[nodeNumber-1] %= 10;