📁C Files
In C, you can create, open, read, and write to files by declaring a pointer of type FILE
, and use the fopen()
function:
Here are the 3 modes you can specify:
Here is an example:
Writing to a file:
if you want to write to a file, you first specify the path and the W mode and use fprintf:
if there is already content it will overwrite it, if you want to append, you use the a mode:
Last updated