i wonder,why there 's no additional explanations/comments like
1)what ' s an error?
2) is MAXNUM lenght of file? if yes, then how you count it?? probrbley , mistake is not there, where you are looking it
try to work with "cars.txt" instead of "cars.dat" , i dont know , if fscanf works with .dat files