A
axcytz
Hi all,
I have a data that looks like this:
1,2,3
1,3,4
2,4
1
2,4,5,6
I have these data in an excel file but can also copy into a txt file. I have declared a vector in c++ and want to read these data into my c++ code. For small problems, I typed it manually in my c++ code as:
int init1[] = {1,2,3};
std::vector<int> row1( init1, init1+sizeof(init1)/sizeof(init1[0]));
P.push_back(row1);
int init2[] = {1, 3, 4};
std::vector<int> row2( init2, init2+sizeof(init2)/sizeof(init2[0]));
P.push_back(row2);
and so on.
How can I import these data from txt or excel file?
Thanks
I have a data that looks like this:
1,2,3
1,3,4
2,4
1
2,4,5,6
I have these data in an excel file but can also copy into a txt file. I have declared a vector in c++ and want to read these data into my c++ code. For small problems, I typed it manually in my c++ code as:
int init1[] = {1,2,3};
std::vector<int> row1( init1, init1+sizeof(init1)/sizeof(init1[0]));
P.push_back(row1);
int init2[] = {1, 3, 4};
std::vector<int> row2( init2, init2+sizeof(init2)/sizeof(init2[0]));
P.push_back(row2);
and so on.
How can I import these data from txt or excel file?
Thanks