C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28630
Number of posts: 94612

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

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.