T
thomas
Hi, a question about vectors
----code---
vector<vector<int> > vi;
vi.resize(5);
for(int i=0;i<5;i++)
vi.resize(5,0);
-----code----
I can compile it and it works right on my gcc, but when I compile and
test it using a system on some other unknown machine, it can not work.
Output the vi matrix can only display the first row.
I want to know if vector can be used in this way? Is it supported by c+
+ std? Is there any fault to my code? thanks.
----code---
vector<vector<int> > vi;
vi.resize(5);
for(int i=0;i<5;i++)
vi.resize(5,0);
-----code----
I can compile it and it works right on my gcc, but when I compile and
test it using a system on some other unknown machine, it can not work.
Output the vi matrix can only display the first row.
I want to know if vector can be used in this way? Is it supported by c+
+ std? Is there any fault to my code? thanks.