multi dimensional array

Discussion in 'C Programming' started by garagerules.fsnet.co.uk, Jul 26, 2003.

  1. How can i create a 2 dimensional array of "strings" ? I have tried :
    char *keys[][] ;
    no joy
    Thanks for any help
    matt
     
    garagerules.fsnet.co.uk, Jul 26, 2003
    #1
    1. Advertising

  2. garagerules.fsnet.co.uk

    Morris Dovey Guest

    garagerules.fsnet.co.uk wrote:

    > How can i create a 2 dimensional array of "strings" ?


    Matt

    You might find it easier to work with a 2-dimensional array of
    pointers to strings...
    --
    Morris Dovey
    West Des Moines, Iowa USA
    C links at http://www.iedu.com/c
     
    Morris Dovey, Jul 27, 2003
    #2
    1. Advertising

  3. "garagerules.fsnet.co.uk" <> wrote in message news:<vKyUa.511$>...
    > How can i create a 2 dimensional array of "strings" ? I have tried :
    > char *keys[][] ;
    > no joy
    > Thanks for any help
    > matt


    I having been keeping up with the latest C standard so there may be a
    better way to do this now...but to create a multi-dimensional array
    you simply:

    char array[10][10];

    And keep adding dimensions as you need them. I can't remember what,
    if any, limit there is on the dimensions but I have always used the
    rule of thumb that if you can't draw it then you can't use it. This
    means that at most you can have a four dimensional array (x,y,z, and
    time).

    Hope that helps...

    Marty
     
    SuperCoder2036, Jul 27, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kk_oop
    Replies:
    1
    Views:
    2,175
  2. Replies:
    7
    Views:
    855
    Ryan Stewart
    Feb 20, 2005
  3. John Harrison
    Replies:
    2
    Views:
    722
    John Harrison
    Jul 14, 2003
  4. Venkat
    Replies:
    4
    Views:
    1,006
    Venkat
    Dec 5, 2003
  5. Wirianto Djunaidi
    Replies:
    2
    Views:
    222
    Wirianto Djunaidi
    Apr 29, 2008
Loading...

Share This Page