Background: I've been a C programmer since almost the year it was invented. That matters because of the problem that I found today. You'll see it immediately.
int startPosition = 0;
for (int startPosition = 0; startPosition<max; startPosition++) {
// Search for something in a buffer. Break when found.
if (buffer[startPosition] == SEARCHED_VALUE) {
break;
}
}
buffer[startPosition] should contain the value that I was looking for. It took me several hours to figure out why startPosition was always 0!
Part of the problem was the difficult debug environment that involved downloading code to an engine computer and running the diesel engine.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Background: I've been a C programmer since almost the year it was invented. That matters because of the problem that I found today. You'll see it immediately.
int startPosition = 0;
for (int startPosition = 0; startPosition<max; startPosition++) {
// Search for something in a buffer. Break when found.
if (buffer[startPosition] == SEARCHED_VALUE) {
break;
}
}
buffer[startPosition] should contain the value that I was looking for. It took me several hours to figure out why startPosition was always 0!
Part of the problem was the difficult debug environment that involved downloading code to an engine computer and running the diesel engine.