File I/O

This is a discussion on File I/O within the C Programming forums, part of the General Programming Boards category; Hey guys, i have quick question. I have to read in a values from txt file. values are like this ...

  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,047
    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, 08:35 AM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01: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, 04:56 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21