Results 1 to 3 of 3

Thread: Array Index as a C-String or char*

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Newfoundland
    Posts
    71

    Array Index as a C-String or char*

    Is it possible to create an array with a non-int (ie: C-String or char*) index?

    A PHP Example of what i'm asking:
    PHP Code:
    $arrayName['myindex1'] = "My Text 1";
    $arrayName['myindex2'] = "My Text 2"
    is it possible to do something like this in C++?
    - Adam Lundrigan

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Yes. Take a look at the Standard Library map template.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Location
    Newfoundland
    Posts
    71
    Thanks. I'll look into it
    - Adam Lundrigan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width