2.2.3.17.16 TreeNode::GetNodeCount

Description

Get the number of children nodes in the tree node.

Syntax

int GetNodeCount( )

Parameters

Return

number of nodes in the node

Examples

EX1

void TreeNode_GetNodeCount_ex1()
{
    Tree tr;
    TreeNode tn1, tn2, tn3;
    tn1 = tr.AddNumericNode(123, "node1", 1);            
    tn2 = tr.AddTextNode("abc", "node2", 2);
    tn3 = tn2.AddTextNode("abc", "node3", 2);
    out_tree(tr);
    printf("number of nodes in tree = %d", tr.GetNodeCount()); 
    // should be 2
}

Remark

See Also

Header to Include

origin.h