Standard Disk I/O

If you can read input from the keyboard and write output to the screen, you'll find standard disk files relatively easy to manipulate. There are three rules to remember:

1.You can't do anything with a disk file until you open it. The act of opening a file gives you a FILE pointer through which you can access the file.

2.While the file is open, you can use most of the screen and keyboard I/O functions if you precede them with the letter f (fprintf instead of printf, for example). The file-handling functions work the same as their counterparts, but you must add the FILE pointer.

3.When you're finished with a file, it's good programming practice to close it. When exit ends the execution of a program, all previously open files are closed and their buffers cleared. If you would rather keep the contents of the buffer, use _exit instead of exit.