When writing a file, use the w option to open the file
/*
Example: write in file in C language
*/
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char const *argv[]) {
FILE *fp=fopen("test.txt","w"); // fp(file pointer)
fputs("Hello lautturi",fp);
fclose(fp);
return 0;
}Sourcww:ew.lautturi.com