![]() |
sponsored links |
|
|
sponsored links
|
|
|
2
21st April 22:09
External User
Posts: 1
|
"vizlab" <lianjian@caip.rutgers.edu> skrev i meddelandet
news:f406ff9.0307051102.27baf6b7@posting.google.co m... There is no use in allocating the vector object dynamically, becase it is just a small book keeping object. The storage for its content will be dynamically allocated anyway. Method III is to tell the vector exactly what you want, and let it do the initialization. I believe this creates fewer temporary objects, as the same empty row is copied to all the others: vector<vector<int> > p(numobjs, vector<int>(numnodes)); Bo Persson bop2@telia.com [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |
|