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:
Code:
struct tree_node
{
int x, y;
int visited;
int UCT_value;
double percentage;
tree_node *parent;
}
Here is where it is declared as a 2d array:
Code:
vector<vector<tree_node*> > board_values
Here is what I attempted to do to initialize two things:
Code:
board_values(10, vector<tree_node*>(11, tree_node->x // and tree_node->y
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?