I\'m having a hard time with a do-while loop, that is supposed to stop when we reach the end of the file. Here\'s the loop code:
do {
if (pcompanyRow[0]
I would change your loop and logic to use this:
while (fgets(pcompanyRow, 1024, f) != NULL) {
/* do things */
}
when fgets() attempts to read past the end of the file, it will return NULL and you'll break out of the loop. You can still continue to use pass and your other flags/logic, but the conditions you check for will be slightly different.