TreeNode::Use

ClassName

TreeNode

AccessType

public

Name

Use

Declaration

int Use

Remark

Use is an treenode attribute.

Examples

EX1

void TreeNode_Use_ex1()
{
    // access Use by property
    Tree tr;                        // Declare a Tree variable
    tr.abc.Use = 0;                 // Add a tree node named "abc" and set Use to 0
    int nn = tr.abc.Use;            // Read Use 
    out_int("nn = ", nn);           // Output: nn = 0
 
    //access Use by TreeNode::SetAttribute and TreeNode::GetAttribute
    TreeNode trN = tr.AddNode("def");               // Add a tree node named "def" 
    trN.SetAttribute(STR_USE_ATTRIB, 1);            // Set Use to 1
    
    int kk;
    if( trN.GetAttribute(STR_USE_ATTRIB, kk) )    // Get Use value
    {
            out_int("kk = ", kk);                   // Output: kk = 1
    }
    else
    {
            out_str("Error, Use attribute not exist.");
    }     
}

Description

Read or write treenode's Use attribute.

header to Include

origin.h

See Also

Reference