Hi every body I know the Thread is very old but this problems occur and will occur a lot of more times.
The trick is this :
OFFSET=0;
RA=0;
fread(&RA,sizeof(RA),1,arq_index);
fread(&OFFSET,sizeof(OFFSET),1,arq_index);
while (!feof(arq_index)){
printf("%s\n%s%ld\n%s%ld\n","------------------","RA : ",RA,OFFSET : ",OFFSET);
fread(&RA,sizeof(RA),1,arq_index);
fread(&OFFSET,sizeof(OFFSET),1,arq_index);
}
First of all never declare the variables in a loop, then You have to read the files before the while loop, then inside the loop do what ever You want, and in the end You have to read again the files. This is the correct way it works.