Documentation Project 1
ContentsIndexHome
PreviousUpNext
sack::LinkLast Macro
C++
#define LinkLast( root, type, node ) if( node ) do { if( !root ) \
    { root = node; (node)->me=&root; } \
    else { type tmp; \
    for( tmp = root; tmp->next; tmp = tmp->next ); \
    tmp->next = (node); \
    (node)->me = &tmp->next; \
    } } while (0)

Link a node to the end of a list. Link thing inserts the new node as the new head of the list.

Copyright (c) 2010. All rights reserved.
What do you think about this topic? Send feedback!