Loading
submit to reddit
June 19, 2013, 11:51:53 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome!
 
   Forum Home   Help Search Forum Login Register  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: Using Text/Binary Files In C Programming  (Read 547 times)
Haitam
Newbie
*
Posts: 16


« on: June 11, 2011, 06:58:07 AM »

How Can I Use a File that the User enter it Name?
Logged
Haitam
Newbie
*
Posts: 16


« Reply #1 on: June 23, 2011, 03:49:09 AM »

Ok I Found The Answer Thanks For Everyone Tried to Help...
first we scan the name of the file from the user to a parameter of type Char...actually as string...then we just put the parameter instead of the file name..

printf("please enter the name of the file: ");
scanf("%s",&path);
FILE* f=fopen(path,"r");

 
use the file whatever you want Smiley
Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!