Guys,
Your help will be appreicated in this matter.
i have to read a text file which has rows and columns into a vector. The text file could be of any size.
000000000
010010001
010010011
001001001
Now, how do I upload this text file on to a 2D vector?
so far, I have come up with this code:
ifstream in ("block.in");
ofstream out("block.out");
vector<vector<int>> block;
for (int i = 0; i < ???; ++i)
block.push_back(*istream_iterator<int>(in));
I don't know if this is correct at all. I am sorry guys, bear with me, I am new to the whole STL thing.
Any help would be appreciated.