Thread: File I/O

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    1

    File I/O

    Hey guys, i have quick question.
    I have to read in a values from txt file.
    values are like this

    0, 0, 3, 64, 0, 0, 0, 0
    2, 0, 6, 64, 0, 0, 0, 0
    4, 0, 4, 64, 0, 0, 0, 0
    6, 0, 5, 64, 0, 0, 0, 0
    8, 0, 2, 64, 0, 0, 0, 0

    i need to get each integer in to 2d array.
    how should i approch this.
    any help would be appreciated

  2. #2
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    Use fscanf() in a loop to populate a 5 x 8 array of ints.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. 2 questions surrounding an I/O file
    By Guti14 in forum C Programming
    Replies: 2
    Last Post: 08-30-2004, 11:21 PM
  4. File I/O problems!!! Help!!!
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 05-17-2002, 08:09 PM
  5. advice on file i/o
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-29-2001, 05:56 AM