How to load a file on a C program? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's 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 its 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?

KostasPlatisKostasPlatis Posts: 1Member

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.

Name:");
gets(search); //"search" is the name of the file to load
FILE *fp;
fp=fopen


I want to know how to write the fopen command in order to search for the file inside a specific folder

Sign In or Register to comment.