I had this same problem a few weeks ago trying to open a text file.
Just thought I'd add a reply to this aswell. My code assumes the person doesn't know the file extension and adds on ".txt" but you can change that to anything you like.
Code:
#define LNAME "C:\\Documents and Settings\\" /* loadfile location */
int load()
{
int i;
int len;
char file_name[50];
char load_location[50] = LNAME;
printf(" Enter file name: ");
fflush(stdin);
fgets(file_name, sizeof(file_name), stdin);
/* remove newline left by fgets */
len = strlen(file_name);
if (file_name[len-1] == '\n')
file_name[len-1] = 0;
strcat(load_location, file_name);
strcat(load_location, ".txt");
FILE *file = fopen(load_location, "r");
}