Once again... you had to have the filename to open the file, whether it is by fopen() or CreateFile().
If the filename is user input, you already have it in a string, just save the string.
If the filename is "hard coded" make it a #define and use that.
The point being that in order to open the file you had to know it's name at some point... why would you not just use that?
#define FILENAME "c:\\myspace\\myfile.txt" // global filename
// later
FILE *fp = fopen(FILENAME,"r+");
// still later
printf("The filename is : %s,FILENAME);
or
char FileName[256] = {0}; // declared at global scope
// later
fprint("Enter the filename : ");
fgets(FileName,255,stdin);
fopen(FileName,"r+");
// still later
printf(The filename is : %s",FileName);