Please don't give me a hard time. Just look at the section of code and make some suggestions.
Data that should not gotten past the if statement and is not in fp is in fc.
You can see that what is being tested is also being written when the condition is true. Its written even when the condition is false into fc and not in fp.
Suggestions on where to look or what to do?
Code:
else if( ((strcmp(&Paverages[i*pagesize + 0*rowsize + 2*element],"C") == 0) &&
(atoi(&Paverages[i*pagesize + 3*rowsize + (cols-1)*element]) + atoi(&Paverages[i*pagesize + 4*rowsize + (cols- 1)*element]) ) > 50))
{
printf ("%d\n",atoi(&Paverages[i*pagesize + 3*rowsize + (cols-1)*element]) + atoi(&Paverages[i*pagesize + 4*rowsize + (cols- 1)*element]) );
p++;
fwrite(&Paverages[i*pagesize], sizeof(char), pagesize, fp);
fprintf(fc, "%s, %s\n", &Paverages[i*pagesize + element], &Paverages[i*pagesize + 2*element]);
for (m = 0; m < cols; m++)
fprintf(fc, ",%s", &Paverages[i*pagesize + 3*rowsize + m*element]);
fprintf(fp, "\n");
for (m = 0; m < cols; m++)
fprintf(fc, ",%s", &Paverages[i*pagesize + 4*rowsize + m*element]);
fprintf(fp, "\n");
for (m = 0; m < cols; m++)
fprintf(fc,",%d", atoi(&Paverages[i*pagesize + 3*rowsize + m*element]) + atoi(&Paverages[i*pagesize + 4*rowsize + m*element]));
fprintf(fc, "\n");
}
Data that should not gotten past the if statement and is not in fp is in fc.
You can see that what is being tested is also being written when the condition is true. Its written even when the condition is false into fc and not in fp.
Suggestions on where to look or what to do?