# Tree struct example ```cpp= #include<stdio.h> #include<vector> using namespace std; typedef struct node { int value; vector<struct node*> children; } Node; int main() { Node* root = new Node(); root->value = 1; Node* node2 = new Node(); Node* node3 = new Node(); node2->value = 2; node3->value = 3; root->children.push_back(node2); root->children.push_back(node3); printf("%d %d %d\n", root->value, root->children[0]->value, root->children[1]->value); return 0; } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up