Hi, i'm messing around with files in C and i've got a little question. I've done a little bit of searching but I can't seem to come up with anything pertaining to my question in a Unix/Linux environment.
I want to create a file in a subdirectory, but I'm not exactly sure how to.
I know to create a file in the current directory, I have to do the following:
Code:
FILE *ofp = fopen("Blah","w");
But how would I do a subdirectory. Suppose i'm at r00t and I want to write to a file in a subdirectory affectionately named, "a".
I've tried:
Code:
FILE *ofp = fopen("//a//Blah","w");
which just yields a segmentation fault error.
This is something I should have been able to find w/ google, but I've been unsuccessful. Thanks for any help.