Originally Posted by
Sebastiani
The compiler uses the '\' in string literals to signal a control character sequence (such as "\n"). So two of them are used to instruct the compiler to generate one, eg:
"\\\\\\" -> "\\\"
So the problem is elsewhere. Can you post a working (eg: compilable) example of the problem?
>> What is the & operator doing here ? Its an array and its automatically supposed to decompose into an address? .
thanks for the advice, i am going to review this and see whats what, i dont understand the second part about &operator? i thought always used this with scanf, meaning 'read value input into address of...' you mean i should just write ("%s", fName) ?
Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *NumData;
char fName[200];
char fPath[200] = "c:\\myfile.txt";
printf("Enter filename |> ");
scanf("%s", &fName);
strcat(fPath,fName);
NumData = fopen(fPath, "r");
system("PAUSE");
return 0;
}