I have an string array filled with words from a sentence.
words[0] = \"the\"
words[1] = \"dog\"
words[2] = \"jumped\"
words[3] = \"over\"
words[4] = \"the\"
word
If you're using C++ then just create a class to represent your key-value pairs:
Class foo {
key : String
values : list of values
}
Then, create a map that maps each key to an object containing its values.
This is simple, extendable, and can be done in any OO-language.
Sorry, my C++ is rusty so the syntax is wrong, but the essential idea is straightforward.