2.2.3.17.4 TreeNode::Children

ClassName

TreeNode

AccessType

public

Name

Children

Declaration

Collection<TreeNode> Children

Remark

Examples

EX1

void TreeNode_Children_ex1()
{
    Tree myTree;
    TreeNode tn1, tn11, tn12;
    tn1 = myTree.AddTextNode("abc", "Name", 1);
    tn11 = tn1.AddTextNode("def", "Addr", 11);
    tn12 = tn1.AddTextNode("ghi", "Mail", 12);
    out_tree(myTree);
    /*
                myTree
                   |
                Name(abc)
				/        \
			Addr(def)  Mail(ghi)
    */
 
    foreach(TreeNode tn in tn1.Children)
    {
        // Display each children's value
        out_str("Children value = " + tn.strVal);
    }
}

Description

Children are all next level's nodes that are direct adjacent to "this" node.

Header to Include

origin.h

See Also

Reference