Thread: Indexing arrays

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    1

    Cool Char Indexing arrays

    I am trying to create an array of objects where the index value is a string instead of an int, for example instead of:

    Code:
    array[0] = object1;
    array[1] = object2;
    I would like to have:

    Code:
    array[A2] = object1;
    array[E4] = object2;
    Please can anyone tell me whether this is possible. I know the syntax for creating a usual array:

    ClassName arrayname[arraysize]

    But what would be the syntax to create an array with the string indexes.

    Thank you for any help you can provide.

    Dutch
    Last edited by Dutch; 12-09-2002 at 01:53 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pointers & arrays and realloc!
    By zesty in forum C Programming
    Replies: 14
    Last Post: 01-19-2008, 04:24 PM
  2. Replies: 16
    Last Post: 01-01-2008, 04:07 PM
  3. Need Help With 3 Parallel Arrays Selction Sort
    By slickwilly440 in forum C++ Programming
    Replies: 4
    Last Post: 11-19-2005, 10:47 PM
  4. Arrays Indexing Intialization
    By jshamilton73 in forum C++ Programming
    Replies: 7
    Last Post: 06-06-2003, 02:26 PM
  5. Crazy memory problem with arrays
    By fusikon in forum C++ Programming
    Replies: 9
    Last Post: 01-15-2003, 09:24 PM