Home Segments Index Top Previous Next

546: Mainline

To read from a file, you first declare a file pointer using FILE as the data type:

FILE* file-pointer name; 

You are probably wondering why the data type, FILE, is in upper-case characters, given that just about every other character string you have seen is in lower-case characters. FILE is upper-case, because FILE is really an implementation-dependent macro that defines a structure. As you have learned, most C programmers adhere to this convention: upper-case for macros.