2.2.3.17.22 TreeNode::IsEmpty

Description

Returns the information on whether the node is empty or not. The node must be valid. The node is considered empty if it has no child nodes or if the value it holds is empty.

Syntax

BOOL IsEmpty( )

Parameters

Return

TRUE if empty, otherwise FALSE.

Examples

EX1

void TreeNode_IsEmpty_ex1()
{
    Tree        tr;
    TreeNode    tn;
    tn = tr.AddNode("Node1");
    if (tn.IsEmpty())
        out_str("The node is empty.");
    else
        out_str("The node is not empty.");
    // Output: The node is empty.
    
    tn.strVal = "xyz";		//Add a string value to tn
    if (tn.IsEmpty())
        out_str("The node is empty.");
    else
        out_str("The node is not empty.");
    // Output: The node is not empty.
}

Remark

See Also

Header to Include

origin.h