Create a file if one doesn’t exist – C
You typically have to do this in a single syscall, or else you will get a race condition. This will open for reading and writing, creating the file if necessary. FILE *fp = fopen(“scores.dat”, “ab+”); If you want to read it and then write a new version from scratch, then do it as two steps. … Read more