Originally posted by VegasSte
When using files, is it not best to check the return value of fopen against NULL so that you can be sure that the file opened OK?
Also, is FILE* infile right, or should it be FILE *infile?
1) Yes. You always want to check the return value of your fopen. It's always good to know for sure your functions work as you expect.

2) The second one is just a matter of preference. Here, C ignores white space. Thus, all of this is the exact same thing:

FILE *infile;
FILE * infile;
FILE* infile;
FILE*infile;

All of those are the exact same thing.

Quzah.