See all articles from CATS v8 n2
As promised talk about how C last month, I’ll accesses files.
The simplest way to discuss how C handles files is to take a look at a C program that uses it. Look at program number 5. This program asks the user for a file name. It then opens the file, reads in a character and prints it out the Screen. This goes on for the entire file.
The program declares a character array of size 20 to be hold the file name. It then declares the integer fd to hold the file ID. When a file is opened, C assigns a number to it. This number is returned from the fopen command to the variable fd.