Help with file read/write
Hi, i'm learning basic file read/write methods and i'm having trouble with this simple program.
It compiles without error but the text file does not show up on my desktop.
I've tried replacing "~" with "file://" and i am still not getting any results
I'm using gcc in Terminal(Mac)
Code:
#include <stdio.h>
int main() {
FILE *handle;
handle = fopen("~/Users/Jem/Desktop/test.txt","w");
if (handle==NULL) {
printf("Error opening file\n");
}else {
fprintf(handle,"TESTING");
fclose(handle);
}
return 0;
}