Maybe you should try something like that:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define EXTENSION ".txt" //the extension we'll add to the file name
int main(void)
{
char fileName[100]; //the file name we'll get
//get the file name
printf("Please, enter the file name, without extension\n");
fgets(fileName,sizeof(fileName),stdin);
//remove \n from the string, and add .txt
fileName[strlen(fileName)-1] = '\0';
strcat(fileName,EXTENSION);
//display result
printf("The full file name: %s\n",fileName);
system("PAUSE");
return 0;
}