Click here to Skip to main content
15,920,217 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL and Efficiency Pin
Andrew Walker17-Sep-03 5:45
Andrew Walker17-Sep-03 5:45 
GeneralRe: STL and Efficiency Pin
Daniel Turini17-Sep-03 9:46
Daniel Turini17-Sep-03 9:46 
GeneralRe: STL and Efficiency Pin
Tim Smith17-Sep-03 10:03
Tim Smith17-Sep-03 10:03 
GeneralUsing CToolTipCtrl Pin
Marty1020304017-Sep-03 5:02
Marty1020304017-Sep-03 5:02 
GeneralRe: Using CToolTipCtrl Pin
Alvaro Mendez17-Sep-03 6:09
Alvaro Mendez17-Sep-03 6:09 
GeneralRe: Using CToolTipCtrl Pin
Jagadeesh VN17-Sep-03 7:34
Jagadeesh VN17-Sep-03 7:34 
GeneralC++ Octree structure Pin
Alex Chitea17-Sep-03 4:20
Alex Chitea17-Sep-03 4:20 
GeneralRe: C++ Octree structure Pin
David Crow17-Sep-03 4:51
David Crow17-Sep-03 4:51 
I haven't written a binary tree since undergraduate school so here is a high-level overview of what might be required:

struct Node
{
    // you'll probably want a data item/pointer here
 
    // pointers to child nodes
    Node *p1;
    Node *p2;
    Node *p3;
    Node *p4;
    Node *p5;
    Node *p6;
    Node *p7;
    Node *p8;
} *pRoot = NULL;
 
void _Add( Node *pNode, Datum *pDatum )
{
    if (NULL == pNode)
    {
        pNode = new Node;
        // assign values accordingly to data items
 
        // make sure pointers start life as NULL
        pNode->p1 = NULL;
        pNode->p2 = NULL;
        ...
    }
    else if (...)
        _Add(pNode->p1, pDatum);
    else if (...)
        _Add(pNode->p2, pDatum);
    else if (...)
        _Add(pNode->p3, pDatum);
    else if (...)
        _Add(pNode->p4, pDatum);
    else if (...)
        _Add(pNode->p5, pDatum);
    else if (...)
        _Add(pNode->p6, pDatum);
    else if (...)
        _Add(pNode->p7, pDatum);
    else if (...)
        _Add(pNode->p8, pDatum);
    else
        assert(FALSE);
}
 
void Add( Datum *pDatum )
{
    _Add(pRoot, pDatum);
}



Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?

GeneralRe: C++ Octree structure Pin
Hosam Aly Mahmoud17-Sep-03 8:53
Hosam Aly Mahmoud17-Sep-03 8:53 
GeneralOpening a Dialog from the menu Pin
Tom Wright17-Sep-03 4:08
Tom Wright17-Sep-03 4:08 
GeneralRe: Opening a Dialog from the menu Pin
HalfWayMan17-Sep-03 4:18
HalfWayMan17-Sep-03 4:18 
GeneralRe: Opening a Dialog from the menu Pin
Tom Wright17-Sep-03 4:56
Tom Wright17-Sep-03 4:56 
GeneralRe: Opening a Dialog from the menu Pin
HalfWayMan17-Sep-03 5:05
HalfWayMan17-Sep-03 5:05 
GeneralRe: Opening a Dialog from the menu Pin
Tom Wright17-Sep-03 5:09
Tom Wright17-Sep-03 5:09 
GeneralRe: Opening a Dialog from the menu Pin
HalfWayMan17-Sep-03 5:12
HalfWayMan17-Sep-03 5:12 
GeneralRe: Opening a Dialog from the menu Pin
Tom Wright17-Sep-03 5:36
Tom Wright17-Sep-03 5:36 
GeneralRe: Opening a Dialog from the menu Pin
David Crow17-Sep-03 5:37
David Crow17-Sep-03 5:37 
GeneralCComboBox Pin
mstanciu200017-Sep-03 2:52
mstanciu200017-Sep-03 2:52 
GeneralRe: CComboBox Pin
David Crow17-Sep-03 3:19
David Crow17-Sep-03 3:19 
GeneralRe: CComboBox Pin
mstanciu200017-Sep-03 20:20
mstanciu200017-Sep-03 20:20 
GeneralRe: CComboBox Pin
Steve S18-Sep-03 1:55
Steve S18-Sep-03 1:55 
GeneralRe: CComboBox Pin
Yonatan10-Nov-03 1:54
Yonatan10-Nov-03 1:54 
GeneralRe: CComboBox Pin
Anonymous10-Nov-03 2:26
Anonymous10-Nov-03 2:26 
GeneralRe: CComboBox Pin
Yonatan10-Nov-03 2:59
Yonatan10-Nov-03 2:59 
Questionhow to display access database into dialog? Pin
coda_x17-Sep-03 2:13
coda_x17-Sep-03 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.