Files in C
Files in C
ADVANTAGE
File operations
• Open a file
• Read data from the file
• Write data into the file
• Closing a file
fopen()
• fp=fopen( char *filename,char *mode)
• Return values
- file pointer if successful
- NULL if unsuccessful
mode description starts..
r open for reading beginning
w open for writing (creates file if it doesn't exist). Deletes content and overwrites the file. beginning
w+ open for reading and writing. Deletes content and overwrites the file. beginning