Is there a way to truncate a file to 0 length in C?
Is there a way to truncate a file to 0 length in C?
Yes, but why would you want to do that?
All you have to do is fopen() the file in "w" mode. If the file exists, it will be truncated to 0 bytes. If it doesn't exist, it will create it.
If you understand what you're doing, you're not learning anything.