File Operations in C
File operations follow four steps every time:- Declare a file pointer
- Open the file with the appropriate mode
- Perform operations (read/write)
- Close the file
1. Writing to a File
write.txt is created in the same directory containing the two lines.
2. Reading from a File
3. Appending to a File
4. Character-by-Character Read
EOF (End Of File) is a constant that signals no more data is available.