i am writing a program that has the user input a file and then the file goes through two functions. I am having trouble opening the file. here is the code.
Code:printf("Enter the file to open: "); scanf("%s", &f); if((fp = fopen(f,"rt")) == NULL) { printf("NO SUCH FILE"); } fgets(f, sizeof(f), stdin); fopen("fp", "r"); while((fp = fopen(f,"rt")) == NULL) { fgets(f, sizeof(f), stdin); DI = dividing(com, one, two); FI = performance( com, one, two); } fclose(fp);