Alright so, as stated above i have some inquiries on C. Ive made a simple C program that opens a .txt file on my desktop, and i wanted to expand on the program by allowing the user to enter in what file on the desktop he/she wants to open by typing it on the screen, ive come across some problems though... Any help would be appreciated.
char filename [20] = {'\0'};
printf("What is the filename you wish to open?");
scanf("%s",filename);
FILE *file = fopen("C:\\Users\\Ricardo\\Desktop\\%s.txt", filename ,"r");
As you can see i attempted to do this by, making a char array, storing the user inputtharray, andthen injecting the string in the fopen function.Whenever i try this though it just says to many arguments in fopen.


