i am new to c i finished all the fundamentales and now i am studying the file header stdio.h
and found w
and w+
#include <stdio.h>
int main(){
FILE *file = fopen("test.txt", "w+");
fprintf(file, "hello world");
char buffer[992];
fscanf(file, "%s", buffer);
printf("%s", buffer);
}
confusing because they both erase the file even before reading i don't get the point of using them where is the difference ?