Код: Выделить всё
std::vector vec1{ "one","two","three" };
std::vector vec2{ "1","2","3" };
std::vector vec3{ "i","ii","iii" };
Код: Выделить всё
struct MyData {
std::string str1;
std::string str2;
std::string str3;
};
Код: Выделить всё
std::vector myData;
myData.reserve(vec1.size());
for (int i = 0; i < vec1.size(); ++i) {
myData.emplace_back(vec1[i],vec2[i],vec3[i]);
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... -vector-of
Мобильная версия