You didn't pass your file pointer into fn_out() . You created another one which was destroyed when the function ended. Passfp into your open function.
Also, see this about scanf() and this about fflush()
WaltP
Posting Sage w/ dash of thyme
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944