1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Reading data file into 2D array

Discussion in 'C' started by Rangerbob86, Mar 7, 2011.

  1. Rangerbob86

    Rangerbob86 New Member

    Joined:
    Mar 31, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Basically I have a data file that has "slides" on it. They are layed out like this:

    1
    . . . . . . . . . . . . . . . . . 1
    . .
    . .
    . .
    . THE BEGINNING
    . .
    . .
    . .
    . .
    . . . . . . . . . . . . . . . . . .

    The first line only contains a number, which I can store to some variable. The next 10 lines (each with 36 characters) are supposed to represent a slide (the spacing appears off in the post but is correct in the compiler). I am trying to store each individual character into the array char image [10][36]. There are 14 of these slides in the data file that I need to store in 14 separate 2d arrays. I'm not very familiar with using data files as it is, so am confused as to what the best way to do this would be. Any help is appreciated. Thanks!
     

Share This Page