HI I have a .txt file that has a data that i have read and saved inside a vector container. now those data saved has a mixture of strings and integers. by the way the vector is declared as vector<string> vect;
meaning
data1:data2:data:data4:data5:data6........
all the data position in the odd numbers are strings, all the data position in even are integers. what i want to do is to add the data saved inside the vector but only the ones in the even positions. is that possible ?
vector<string> data = { "1", "Bla", "2", "Bla Bla", "3", "Dummy"};
for (size_t i = 0; i < data.size(); i++)
{
if (i % 2 == 0) // even
{
int num = stoi(data[i]);
// use num
}
}