David Ireland
Baseband Member
- Messages
- 63
How can i open a file for reading and writing in a directory other than "C:\"??
All I know is this...
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. So to clarify...if i were to write C:\directory\text.txt it fails...i tried putting C:\\directory\\text.txt but that fails too.
Thanks.
All I know is 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. So to clarify...if i were to write C:\directory\text.txt it fails...i tried putting C:\\directory\\text.txt but that fails too.
Thanks.