I hate to sound like a prick but... using fscanf is generally a bad idea. There are plenty of reasons, but a big one is that most people don't really understand what its doing. Therefore it usually only works with carefully formatted input. Or by accident.