I would be most grateful if people could have a look over this snippet of code and let me know what could a possible cause for the floating point exception.
Info:
- branches is an int array size 200
- line is a char array size 20
- The loop runs fine 6 times, then the exception occurs.
I am confused because there is no division, float or integer, that could cause this.
for (count = 0; count < sizeof(branches); count++){
if (fgets(line,sizeof(line),fp)==NULL)
break;
else {
int branch_taken = line[16] - 48;
branches[count] = branch_taken;
}
}