Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How to load a file on a C program?
Hello I have a program to write and I want to make it load a file.The problem is that I want the user to give the name of the file that he wants to load.He will write the name of the file and the program will search for the file in a certain folder(I know the name of the folder)and then load it in the program.A part of my code so far is:
printf("Give the name of the file you want to open.
gets(search); //"search" is the name of the file to load
I want to know how to write the fopen command in order to search for the file inside a specific folder