You can erase a file using remove(). Its prototype is
int remove(char *file-name);
You can position a file's current location to the start of the file using rewind(). Its prototype is
void rewind(FILE *fp);
Hopefully I have given you enough information to at least get you started with files. Its really rather easy once you get started.