Thread: how can i read i line from a file

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    80

    how can i read i line from a file

    how can i read a line form a file in c is there any function like readline() or anything else

    for example
    a = 5
    b = b+5

    how can i read each line and save it in different strings

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    20
    use fscanf()


    greetz

  3. #3
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,164
    I agree, fgets()

    fscanf() causes headaches at times.

    Walt

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. OPen a file and read it from the last line
    By c_geek in forum C Programming
    Replies: 14
    Last Post: 01-26-2008, 06:20 AM
  3. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  4. getline function to read 1 line from a text file
    By kes103 in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 06:21 PM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM