How would I initialize certain fields in a struct in a class constructor?
I want to create a 11x11 vector.
Say I have the struct:
Here is where it is declared as a 2d array:Code:struct tree_node { int x, y; int visited; int UCT_value; double percentage; tree_node *parent; }
Here is what I attempted to do to initialize two things:Code:vector<vector<tree_node*> > board_values
and I got stuck on how to initialize it. Would I have to manually malloc/new, set the fields to zero manually for each, then push it on the vector 121 times?Code:board_values(10, vector<tree_node*>(11, tree_node->x // and tree_node->y



1Likes
LinkBack URL
About LinkBacks


