A FILE* is a handle from fopen. You write with fprintf, then fclose so the data actually lands on disk.
A file on disk is a stream of bytes with a name. fopen gives you a handle (FILE*), you read or write through that handle, then fclose so the data actually lands and the handle is released.
notes.txt
Hello
save
Hello
Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. fopen(..., "w") will:
Write mode.
2. If fopen returns NULL:
Check.
3. fprintf is like printf but:
To a file.
4. fclose is needed because:
Close.
5. "r" vs "w":
Mode.