C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28691
Number of posts: 94711

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How to load a file on a C program? Posted by KostasPlatis on 3 Jan 2013 at 7:46 AM

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.\n\nName:");
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




 

Recent Jobs