cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
vc++ twu dimensional vector in CLR
vc++ twu dimensional vector in CLR
Jun 6, 2010 at 2:50pm UTC
rambo19D
(1)
Hello,
I have one problem with something like this.
I have vector 2D:
vector < vector <int> > tab(1000);
and i try:
tab[1].push_back(1);
and this is not working. When i push "." i dont see any tips (for example push_back).
tab.push_back(1) is working.
This is Class Library in c++ clr.
This is normal? i cant work with twu dimensional vector?
Jun 6, 2010 at 5:15pm UTC
Albatross
(4553)
I'd recommend using
tab.at(1).push_back(1);
. It's safer and it doesn't confuse autofills, and the second statement that you say works doesn't do what you think it does.
-Albatross
Topic archived. No new replies allowed.