strcar keep closing my program
i have made a program, i had code that said
Code:
void main()
{
char a[20];
char txt[20];
char final[50];
printf("please enter file name: ");
scanf("%s,a);
strcat(final , a); //with out this it works
strcat(final, txt ); //and this
file = fopen(a,"w");
fprintf(file,"%s",a);
}
im not online with this computer so ive just writen out a similar problem, well its the same really.
the program ends its self when i add in the strcat statments. without its fine.
does anyone know why this is?