How can i open a file for reading and writing in a directory other than "C:\"??
This is the only way I know how to do this...
Code:
if((fp = fopen("C:\hello.txt, "w")) != NULL)
{
fprintf(fp, "Hello.");
fclose(fp);
}
else
puts("Write Failed.");
So when I do that all i can read and write are files in C:\ and no other directory...like C:\whatever...if i try that it fails. To clarify, If i were to write C:\directory\text.txt in up there, it fails. I also tried C:\\directory\\text.txt but that fails too.
Thanks.