open with overwrite c

include

include

include

int main() { FILE *file; file = fopen("example.txt", "w"); if (file == NULL) { printf("Error opening the file!\n"); exit(1); } fprintf(file, "This is an example text."); fclose(file); return 0; }