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

C / C++ / MFC

 
GeneralPop-up menu artifact Pin
Luis Mejia20-Sep-03 9:07
Luis Mejia20-Sep-03 9:07 
GeneralRegistry path from handle Pin
User 988520-Sep-03 7:55
User 988520-Sep-03 7:55 
GeneralRe: Registry path from handle Pin
David Crow20-Sep-03 17:01
David Crow20-Sep-03 17:01 
GeneralRe: Registry path from handle Pin
Jason Henderson20-Sep-03 17:54
Jason Henderson20-Sep-03 17:54 
GeneralProblem with Rich Edit Control Pin
raheela20-Sep-03 7:54
raheela20-Sep-03 7:54 
GeneralRe: Problem with Rich Edit Control Pin
Mike Dimmick20-Sep-03 12:54
Mike Dimmick20-Sep-03 12:54 
Generalproblem while using activeX control in regular dll using shared MFC DLL Pin
bhalchan20-Sep-03 5:57
bhalchan20-Sep-03 5:57 
Generalpassing data structures Pin
Sirrius20-Sep-03 5:09
Sirrius20-Sep-03 5:09 
I need help finishing up my project. I am really close I think.
I need to pass a binary tree in a treeNode::output to the List::insertNode to be inserted into a linked list. I've exhausted all ideas I can come up with and just dont see the light.
Thanks, here is the code I have.


<pre>#include <iostream>
#include <string>
#include "List.h"

using namespace std;






class treeNode
{

string name;
treeNode *smaller, *bigger;
friend class List;
public:


treeNode(string newName="", treeNode *newSmaller=NULL, treeNode *newBigger=NULL)
{
name=newName;
smaller=newSmaller;
bigger=newBigger;
}

void add(string newName)
{
if(newName<name)
{
if(smaller==NULL)
smaller=new treeNode(newName);
else
smaller->add(newName);
}
if(newName>name)
{
if(bigger==NULL)
bigger=new treeNode(newName);
else
bigger->add(newName);
}
}


void output(treeNode *name,List &l)
{
if(smaller!=NULL)
smaller->output(name,l);


l.insertNode(l);

if(bigger!=NULL)
bigger->output(name,l);
}



};



void main()
{

List l;
treeNode t;
string newName;
int howMany;

cin >> howMany;

for(int i=0; i<howMany; ++i)
{
cin >> newName;
t.add(newName);
//l.insertNode(treeNode *t);
}

//t.output(t);
//l.outputList(cout);
}</pre>




GeneralRe: passing data structures Pin
Mike Dimmick20-Sep-03 12:59
Mike Dimmick20-Sep-03 12:59 
GeneralRe: passing data structures Pin
David Crow20-Sep-03 17:13
David Crow20-Sep-03 17:13 
GeneralRe: passing data structures Pin
Sirrius20-Sep-03 17:34
Sirrius20-Sep-03 17:34 
GeneralFile shredder Pin
alex.barylski20-Sep-03 4:58
alex.barylski20-Sep-03 4:58 
GeneralRe: File shredder Pin
JWood20-Sep-03 5:51
JWood20-Sep-03 5:51 
GeneralRe: File shredder Pin
Neville Franks20-Sep-03 12:24
Neville Franks20-Sep-03 12:24 
GeneralRe: File shredder Pin
alex.barylski21-Sep-03 20:29
alex.barylski21-Sep-03 20:29 
GeneralRe: File shredder Pin
ZoogieZork20-Sep-03 12:42
ZoogieZork20-Sep-03 12:42 
GeneralRe: File shredder Pin
alex.barylski21-Sep-03 20:31
alex.barylski21-Sep-03 20:31 
Generalswitch help Pin
coda_x20-Sep-03 1:28
coda_x20-Sep-03 1:28 
GeneralRe: switch help Pin
Rickard Andersson2020-Sep-03 2:11
Rickard Andersson2020-Sep-03 2:11 
GeneralRe: switch help Pin
Michael Dunn20-Sep-03 4:36
sitebuilderMichael Dunn20-Sep-03 4:36 
GeneralMigration from VisualAge C++ for windows to Visual Studio 6.0 - MFC 6.0. Pin
Md Saleem Navalur20-Sep-03 1:23
Md Saleem Navalur20-Sep-03 1:23 
GeneralRe: Migration from VisualAge C++ for windows to Visual Studio 6.0 - MFC 6.0. Pin
Gary R. Wheeler20-Sep-03 3:13
Gary R. Wheeler20-Sep-03 3:13 
GeneralAvoid Flickering in MFC Pin
cberam20-Sep-03 0:23
cberam20-Sep-03 0:23 
GeneralRe: Avoid Flickering in MFC Pin
LunaticFringe20-Sep-03 1:45
LunaticFringe20-Sep-03 1:45 
QuestionWhy TextOut and DrawText can't display certain characters that Notepad can? Pin
hoc_ngo19-Sep-03 23:52
hoc_ngo19-Sep-03 23:52 

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.