Wrong. fp is a pointer to a structure that contains information about the file -- that structure does not contain the filename. Look in stdio.h and you can see what that structure contains, although you may not understand the purpose for all structure members.
so if I used
cout << "the file name is "<< fp << endl;
is suppose to print the filename hi.txt , but actually it prints on screen 00478998.
why is that.
Because fp is not a pointer to the filename, but a pointer to FILE structure.