Thread: 2D array help

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    16

    2D array help

    I'm having a problem with a program, i have a 2D array and each row has a streaming string and i'm guessing you cant access the individual elements cause when i try say for example to output list[0][0] and say i get A, when i try list[0][1], i still get A and my guess is that is becuase it is streaming. is there anyway to access individual elements? i read something about sscanf and how it reads from a string instead of reading from a stream but i dont know how it would work for 2d arrays

    -Dyn4sty22-

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    each row has a streaming string
    And what does it mean? Show the code
    try say for example to output list[0][0] and say i get A, when i try list[0][1], i still get A
    Show the code
    reads from a string instead of reading from a stream
    Stream - is C++ class, we are on the C board, so what are you talking about? Show the code.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    16
    nevermind, i just had a wrong number, my bad

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. from 2D array to 1D array
    By cfdprogrammer in forum C Programming
    Replies: 17
    Last Post: 03-24-2009, 10:33 AM
  2. Help with mallocing a 2d array please?
    By Gatt9 in forum C Programming
    Replies: 5
    Last Post: 10-10-2008, 03:45 AM
  3. 2D array pointer?
    By willc0de4food in forum C Programming
    Replies: 4
    Last Post: 04-23-2006, 08:16 AM
  4. Read file in 2D array
    By Chook in forum C Programming
    Replies: 1
    Last Post: 05-08-2005, 12:39 PM
  5. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM