Be aware that a backslash in a character constant or a string literal introduces an escape sequence. Common examples are '\n' for a newline and '\t' for a tab.
So for #2, your example is not correct.
Code:
FILE *fpData=fopen("c:\pj.dat","r");
To have a backslash in the string literal, it would be coded as follows.
Code:
FILE *fpData=fopen("c:\\pj.dat","r");
Note that this is for string literals as in your case #2. You wouldn't need to enter two backslashes for user input as in case #3. That is to say at the command line you could do something like the following.
Code:
Please enter the path: c:\pj.dat