Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct node{
- int val;
- node* left;
- node* right;
- };
- //Initialize:
- node* root = new node;
- root->val = 7;
- root->left = NULL;
- root->right = NULL;
- int* n = new(6);
- struct node{
- int val;
- node* left;
- node* right;
- node(int);
- };
- node::node(int _v){
- this->val = _v;
- this->left = this->right = nullptr;
- }
- node *root = new node(6); // Works as you want
Add Comment
Please, Sign In to add comment