Hello, I'm working on a project where certain characters can have multiple values.. E.g.

Letter 'A' can be replaced with 'B', 'C', 'D'
Letter 'S' can be replaced with 'X', 'Y'

And then it would output it like this:

A can be replaced with B - Yes/No
A can be replaced with C - Yes/No

Would you use a 2D array?

Thanks :)

Recommended Answers

All 3 Replies

What tools do you have at your disposal? If you can not use the STL then you will probably want to use a 2d char array. If you can use the STL then a multimap might do what you need.

Hey thanks for your reply..

So would would go like this:

int arr[26][10]; // "A" can have 10 different options

Would this work? Or could I use like a Linked-List?

What you have will work just change int to char.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.