TreeNode::TreeNode

Description

Default constructor


Copy Constructor

Syntax

TreeNode( )

TreeNode( TreeNode & tn )

Parameters

tn
[input] the copied treenode.

Return

Examples

EX1

void TreeNode_TreeNode_ex1()
{    
    Tree tr;
    TreeNode tn1;       //Default constructor
    tn1 = tr.AddTextNode("abc", "node2", 2);
    out_tree(tr);
}


EX2

void TreeNode_TreeNode_ex2()
{    
    Tree tr1;
    TreeNode tn1;
    tn1 = tr1.AddTextNode("abc", "node1", 1);
 
    Tree tr2;
    TreeNode tn2(tn1);        //Copy Constructor 
    bool flag = tr2.AddNode(tn2, FALSE); // If the bDeep is FALSE, only add the node tn2 itself.
    
    out_tree(tr1);
    out_tree(tr2);
}

Remark

Copy constructor.

See Also

header to Include

origin.h