I am trying to get the index of an element in a vector of strings, to use it as an index in another vector of int type, is this possible ?
strings
int
If you want an index, you can use std::find in combination with std::distance.
std::find
auto it = std::find(Names.begin(), Names.end(), old_name_); if (it == Names.end()) { // name not in vector } else { auto index = std::distance(Names.begin(), it); }