Ok.... sorry for the ackward phrasing, but basically, if I have a certain value such a Au for gold, and I give it a certain array slot, how can I get the number of the slot it is in? Ala, in the array, I have the first value as H for hydrogen, He for helium as the second, and so on. What should happen is when I get user input for an element, then it returns the atomic number, which should also be its array slot+1?
A map will give worse performance than a array if he needs to find by atomic number, as well.
There's two things you can do:
1. Keep everything single array sorted by atomic number and find symbol->number by using std::find().
2. Keep everything in two arrays: one sorted by atomic number, and the other by symbol. Use indexing on the first one to find number->symbol, and use std::binary_search() on the second one to find symbol->number.
1 is simpler to implement, but 2 gives better performance.