That depends on the type of file and what you mean by "empty". Generally, fopen() called on an existing file, with the "w" option instead of the "a" option will truncate the file to zero length. To delete a file completely is a different process. Function truncate is your friend.
Chat with our AI personalities
opening the file in write mode will erase the contents.
fopen("myfile.txt","w");
Declaration of file pointer opening of file in desired mode. performing the desired operation. closing the file
Ctrl+Z mean EOF in WinDos, no matter what programming language you are using.
Seek to the end of the file (fseek) and check how many bytes are in the file If the byte count is zero the file is empty.
Nothing, but as a file-extension it means backup.
helps you to organise the memory as you want