So what I'm trying to do is compare a string to a large amount of strings contained in a table.
For example say I have the word "Today". And lets say I associate a number with that string say #1. The user will give me the word and then I have to look up the number.
So say in my table I have {"Today, 1}, {"Yesterday, 2}, {"Tomorrow", 3}, {"Monday", 4}....etc, etc, etc.
So lets say the table has 100s of these items. In order to search I don't want to build a wild if_else statement and I cannot use switches.
What I'm trying to find is the right container (right now I'm looking at maps) which I can use to search doing string comparisons. I also want this to be a fixed table data structure that I can keep in C++ when I launch my program. I don't want to use things like SQL, etc to hold a data table. Is this possible? And if not what would you all suggest? Thanks
map is the right data structure, although you have to write code to save the data to file and read it back again. (whether you decide to use a database or just your own flat file is up to you.)
Ok, say I don't want to write data to a file but just build my container at the very beginning of execution time and then use that container at runtime. Would this idea work?