You could use a std::map or std::unordered_map.
You can use it directly, mapping from "name" (as a std::string probably) to whatever resulting value (sounds like another string, in your case).
std::map<std::string, std::string> stuff;
Or you can use it indirectly, using the maps to map from name to array index.
std::vector<std::string> stuff;
std::map<std::string, std::size_t> stuffIndices;
The latter option is more complex, because you may need to update the map if you rearrange the array or whatnot, but it also lets you keep the contiguous storage of the array if you need to use that property elsewhere in your program.