Jump to content

an array with char index

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
chipbu

chipbu

    Newbie

  • Members
  • Pip
  • 9 posts
Hi guys,

I need some help to create an array with character indexing like this:
11A B C D E ....
A 0 0 0 0 0
B 0 0 0 0 0
C 0 0 0 0 0
D 0 0 0 0 0
E 0 0 0 0 0
.
.

so that I can record the occurrence of a particular pair of letters. I tried to search on msdn but found no clue yet.
my guess is that I can use an alphabet enum to assign index to each letter. But the problem is that I cant use alphabet letter as textual data (ie string, char)
Can anybody give me a hint?

Edited by chipbu, 11 April 2010 - 05:48 AM.


#2
semprance

semprance

    Programmer

  • Members
  • PipPipPipPip
  • 126 posts
    public T MyArray[char c]
    {
        //Get the right part of the array.
    }



Hope you can work it out from there. Bit tired lol.

#3
chipbu

chipbu

    Newbie

  • Members
  • Pip
  • 9 posts

semprance said:

    public T MyArray[char c]
    {
        //Get the right part of the array.
    }



Hope you can work it out from there. Bit tired lol.

oh, u're the most helpful. Thanks for that bit. If u're tired, try to get some sleep lol