Exforsys
+ Reply to Thread
Results 1 to 4 of 4

C file handling

This is a discussion on C file handling within the C and C++ forums, part of the Programming Talk category; hey folks..... m still an amateur in this part of d world n m dying get this code cracked. Hv ...

  1. #1
    pradyu is offline Junior Member Array
    Join Date
    Aug 2006
    Answers
    1

    Unhappy C file handling

    hey folks..... m still an amateur in this part of d world n m dying get this code cracked.

    Hv got this program which asks me to print certain data on the screen , for a specified no. of times , by taking the input from a file named input.txt. Can nebody pls explain it to me how I can read the input from d text file n dependin on d i/p , print out d msg on d monitor.


  2. #2
    hat123 is offline Junior Member Array
    Join Date
    Jun 2006
    Answers
    6
    So are you writing a program or do you have an existing program? If you are writing the program, look at the fread, fscanf, and fprint functions. If you have an existing program, then make sure you have the input.txt file with the appropriate data.


  3. #3
    bdsarwar is offline Junior Member Array
    Join Date
    Sep 2006
    Answers
    1
    At first u should open the input.txt file in ur program.
    FILE *file;
    file = open("input.txt","r");
    then u can use fscanf() function in several times and print the data into the console.
    and also close the file by this command
    fclose(file);


  4. #4
    ashlee is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    108
    If you could place the code you have written or on which you have query I can help you out by seeing the code and correct the code and give you for you to use.


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...