Also have a quick look at what you do to i between the fscanf and the printf. That might have something to do with it. You get no output by the way because the while expression immediately evaluates FALSE; this is because fscanf doesn't return 6.