FILE *fd;
char File_name[]="";
<...>
printf("Enter the name of the file where you want the results to be saved. \n");
printf("DON'T FORGET that file must end with .exe \n");
scanf("%s",&File_name);
while(strchr(File_name,'.txt')==NULL)
{
printf("The end of the file name is not correct. Please try again. \n");
printf("File name: ");
scanf("%s",&File_name);
}
Warning: format specifies type 'char ' but the argument has type 'char ()[1]' [-Wformat] scanf("%s",&File_name); ~~~~^~~~~~~~~~
Arrow goes to "&File_name".
How to fix it? Thank you.