how to turn a user input into a text file for example user inputs 100 and the program creates a text file named 100.txt?
I have tried to work it out but it still doesnt work properly.
i used
getc(stdin);
char filename[80];
sprintf(filename,"%d.txt", stdin);
and then i also tried
char line[255];
fgets(line, 255, stdin);
char filename[80];
sprintf(filename,"%d.txt", stdin);
any ideas on why it wont create the text file?