Thread: Reading the first line of a text file and storing in an array

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    10

    Reading the first line of a text file and storing in an array

    hello there,
    Im trying to get one of the functions for my code to work which reads in two text files line by line and compares each line and so far i havent been able to do so, i am trying to read the first line of a text file only and store that in a char array, i have only been able to find how to store an entire file or contents of a directory into an array not the first line, i have tried using fgets but with no avail, any sujestions or things to try would be great
    thanks in advance
    Last edited by Ciaran; 04-01-2011 at 01:13 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 12-13-2010, 02:13 PM
  2. Storing data from text file into array?
    By flaris in forum C Programming
    Replies: 6
    Last Post: 12-02-2010, 02:19 PM
  3. Help - Reading a file and storing it as a 2d Array.
    By MetallicaX in forum C Programming
    Replies: 2
    Last Post: 03-08-2009, 07:33 PM
  4. Replies: 5
    Last Post: 10-02-2005, 12:15 AM
  5. Reading strings from a file and storing into an array
    By Rizage in forum C++ Programming
    Replies: 1
    Last Post: 10-24-2002, 03:04 AM

Tags for this Thread