How to extract the file line from a file using C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanjayaswain
    New Member
    • Aug 2008
    • 1

    #1

    How to extract the file line from a file using C

    I have used fgets() to read the file line by line into an array. My question is how to get the first line of from the array and stored in a structure.
  • arnaudk
    Contributor
    • Sep 2007
    • 425

    #2
    Use strcpy() to copy the string.

    Code removed per Posting Guidelines

    Comment

    • gpraghuram
      Recognized Expert Top Contributor
      • Mar 2007
      • 1275

      #3
      Do You want to access the the first element of the stored array?
      Why cant you push the value to the structure as soon as you read the line from the file?

      Raghu

      Comment

      Working...