No, I mean that fopen returns a pointer to a FILE structure that you can use to manipulate the file, but you just drop this rather essential value by not assigning it to anything. So you have no way of knowing whether or not the file was opened successfully.

Actually you almost do it correctly at the end of the program, but I can't see the point of opening a file just before you exit. What exactly do you think fopen does?