A few things, right of the start in main(). You never check if you successfully open the file, then you attempt to use fscanf to read in strings in two variables (first, last) declared char.