C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to declare the size, and fill vector<vector <T>> ?

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++)
View previous topic :: View next topic  
Author Message
eb
Guest





PostPosted: Wed Sep 13, 2006 9:10 am    Post subject: How to declare the size, and fill vector<vector <T>> ? Reply with quote



I have this working code :

foo.h
/* nothing */

foo.cpp
...
std::vector<std::vector<T *> > my_T(board_size,board_size) ;

for (i=0; i<board_size; i++)

for (j=0; j<board_size; j++)
{
my_T[i][j] = new T ;
my_T[i][j]->do_something_with_my_T()
}
....



I'd like do do the same with :


foo.h
std::vector<std::vector<T *> > my_T


foo.cpp

???? -> pass the size to my_T and fill it with T


Any idea ?
google did not help me there ...


(sorry for the inappropriate vocabulary, I'm not a coder in real life).
Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language (comp.lang.c++) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.