I am having some problems while using fgets and strcat (I tried to replace the fgets into scanf and the program worked). It seems the strcat is not working.
char name[256];
char text[256];
fgets(name,250,stdin);
strcat(name,".txt");
printf("%s\n",name);
The output is (in separate lines):
d
.txt
 
     
     
    