Delete a node from binary tree.

Hi everybody!
This is my code, all work except delete function.
I check it for several times but can't understand what is problem.

//Binary Search Tree Program

#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;

class Map
{
//private:
public:
struct tree_node
{
tree_node* left;
tree_node* right;
double data;
char * key;
};
tree_node* root;

//public:
Map()
{
root = NULL;
}

bool isEmpty() const { return root==NULL; }
void print_inorder();
void inorder(tree_node*);
//void print_preorder();
//void preorder(tree_node*);
//void print_postorder();
//void postorder(tree_node*);
void find(char * ch);
//void clear();
//operator[]()
void insert(char * ch, double d);
void remove(char * dkey);
};

// Smaller elements go left
// larger elements go right

void Map::find(char * ch)
{
bool isfind = false;
tree_node* curr;
curr = root;
while(curr)
{
if(strcmp(ch, curr->key)==0)
{
cout << "Suwestvuyet\n";
isfind = true;
break;
}
else if(strcmp(ch, curr->key)>0)
curr = curr->right;
else if(strcmp(ch, curr->key)<0)
curr = curr->left;
}

if(!isfind)
cout << "Ne suwestvuyet\n";
}

void Map::insert(char * ch, double d)
{
tree_node* t = new tree_node;
tree_node* parent;
t->key = ch;
t->data = d;
t->left = NULL;
t->right = NULL;
parent = NULL;

// is this a new tree?
if(isEmpty())
root = t;
else
{
//Note: ALL insertions are as leaf nodes
tree_node* curr;
curr = root;
// Find the Node's parent
while(curr)
{
parent = curr;
if(strcmp(t->key, curr->key))
curr = curr->right;
else
curr = curr->left;
}

if(strcmp(t->key, parent->key))
parent->right = t;
else
parent->left = t;
}
}

void Map::remove(char * dkey)
{
//Locate the element
bool found = false;
if(isEmpty())
{
cout<<" This Tree is empty! "<<endl;
return;
}

tree_node* curr;
tree_node* parent;
curr = root;

while(curr)
{
if(strcmp(curr->key,dkey)==0)
{
found = true;
break;
}
else
{
parent = curr;
if(strcmp(curr->key, dkey))
curr = curr->right;
else
curr = curr->left;
}
}
if(!found)
{
cout<<" Data not found! "<<endl;
return;
}


// 3 cases :
// 1. We're removing a leaf node
// 2. We're removing a node with a single child
// 3. we're removing a node with 2 children

// Node with single child
if((curr->left == NULL && curr->right != NULL)|| (curr->left != NULL
&& curr->right == NULL))
{
if(curr->left == NULL && curr->right != NULL)
{
if(parent->left == curr)
{
parent->left = curr->right;
delete curr;
}
else
{
parent->right = curr->right;
delete curr;
}
}
else // left child present, no right child
{
if(parent->left == curr)
{
parent->left = curr->left;
delete curr;
}
else
{
parent->right = curr->left;
delete curr;
}
}
return;
}

//We're looking at a leaf node
if( curr->left == NULL && curr->right == NULL)
{
if(parent->left == curr)//////////error///////////////////
parent->left = NULL;
else
parent->right = NULL;
delete curr;
return;
}


//Node with 2 children
// replace node with smallest value in right subtree
if (curr->left != NULL && curr->right != NULL)
{
tree_node* chkr;
chkr = curr->right;
if((chkr->left == NULL) && (chkr->right == NULL))
{
curr = chkr;
delete chkr;
curr->right = NULL;
}
else // right child has children
{
//if the node's right child has a left child
// Move all the way down left to locate smallest element

if((curr->right)->left != NULL)
{
tree_node* lcurr;
tree_node* lcurrp;
lcurrp = curr->right;
lcurr = (curr->right)->left;
while(lcurr->left != NULL)
{
lcurrp = lcurr;
lcurr = lcurr->left;
}
curr->key = lcurr->key;
delete lcurr;
lcurrp->left = NULL;
}
else
{
tree_node* tmp;
tmp = curr->right;
curr->key = tmp->key;
curr->right = tmp->right;
delete tmp;
}

}
return;
}

}


void Map::print_inorder()
{
inorder(root);
}

void Map::inorder(tree_node* p)
{
if(p != NULL)
{
if(p->left) inorder(p->left);
cout <<" Salary[\""<<p->key <<"\"]="; cout <<p->data<<endl;
if(p->right) inorder(p->right);
}
else return;
}

int main()
{
Map salary;
string temp, ftarget, dtarget;
int ch,tmp,tmp1,size;
double data;
while(1)
{
cout<<endl<<endl;
cout<<" Binary Search Tree Operations "<<endl;
cout<<" ----------------------------- "<<endl;
cout<<" 1. Insertion/Creation "<<endl;
cout<<" 2. Print "<<endl;
cout<<" 7. Find "<<endl;
cout<<" 5. Removal "<<endl;
cout<<" 6. Exit "<<endl;
cout<<" Enter your choice : ";
cin>>ch;
char * pch;
switch(ch)
{
case 1 : cout<<" Enter key: ";
cin>>temp;
pch = (char *) malloc(sizeof(char)*temp.size());
strcpy(pch, temp.c_str());
cout << " Enter data:";
cin >> data;
salary.insert(pch,data);
break;
case 2 : cout<<endl;
cout<<" In-Order Traversal "<<endl;
cout<<" -------------------"<<endl;
salary.print_inorder();
break;

case 7: cout << "Enter key: ";
cin >> temp;
pch = (char *) malloc(sizeof(char)*temp.size());
strcpy(pch, temp.c_str());
salary.find(pch);
break;




/*case 3 : cout<<endl;
cout<<" Pre-Order Traversal "<<endl;
cout<<" -------------------"<<endl;
b.print_preorder();
break;
case 4 : cout<<endl;
cout<<" Post-Order Traversal "<<endl;
cout<<" --------------------"<<endl;
b.print_postorder();
break;*/
case 5 : cout<<" Enter key to be deleted : ";
cin >> temp;
pch = (char *) malloc(sizeof(char)*temp.size());
strcpy(pch, temp.c_str());
salary.remove(pch);


break;


}
}
}
[code] tags. That thing is completely unreadable.
State your definition of "problem". How does it behavior stray from what you consider "acceptable"?
void Map::remove(char * dkey)
{
//Locate the element
bool found = false;
if(isEmpty())
{
cout<<" This Tree is empty! "<<endl;
return;
}

tree_node* curr;
tree_node* parent;
curr = root;

while(curr)
{
if(strcmp(curr->key,dkey)==0)
{
found = true;
break;
}
else
{
parent = curr;
if(strcmp(curr->key, dkey))
curr = curr->right;
else
curr = curr->left;
}
}
if(!found)
{
cout<<" Data not found! "<<endl;
return;
}


// 3 cases :
// 1. We're removing a leaf node
// 2. We're removing a node with a single child
// 3. we're removing a node with 2 children

// Node with single child
if((curr->left == NULL && curr->right != NULL)|| (curr->left != NULL
&& curr->right == NULL))
{
if(curr->left == NULL && curr->right != NULL)
{
if(parent->left == curr)
{
parent->left = curr->right;
delete curr;
}
else
{
parent->right = curr->right;
delete curr;
}
}
else // left child present, no right child
{
if(parent->left == curr)
{
parent->left = curr->left;
delete curr;
}
else
{
parent->right = curr->left;
delete curr;
}
}
return;
}

//We're looking at a leaf node
if( curr->left == NULL && curr->right == NULL)
{
if(parent->left == curr)//////////error///////////////////
parent->left = NULL;
else
parent->right = NULL;
delete curr;
return;
}


//Node with 2 children
// replace node with smallest value in right subtree
if (curr->left != NULL && curr->right != NULL)
{
tree_node* chkr;
chkr = curr->right;
if((chkr->left == NULL) && (chkr->right == NULL))
{
curr = chkr;
delete chkr;
curr->right = NULL;
}
else // right child has children
{
//if the node's right child has a left child
// Move all the way down left to locate smallest element

if((curr->right)->left != NULL)
{
tree_node* lcurr;
tree_node* lcurrp;
lcurrp = curr->right;
lcurr = (curr->right)->left;
while(lcurr->left != NULL)
{
lcurrp = lcurr;
lcurr = lcurr->left;
}
curr->key = lcurr->key;
delete lcurr;
lcurrp->left = NULL;
}
else
{
tree_node* tmp;
tmp = curr->right;
curr->key = tmp->key;
curr->right = tmp->right;
delete tmp;
}

}
return;
}

The error is in this function.
I show the error with bold.
I can't understand why this problem.
Because algoritm is correct.
I'm not debugging anything until I see [code][/code] tags around your code. I'm serious, I can't understand anything.
If you don't know how to do it, here's a quick tutorial:
1. Click on the "edit" button to open the edit textbox.
2. Place the caret on the text and hit CTRL+A.
3. To the right of the textbox there's a group of buttons under a label "Format:". At the top right of this group is a button with a "#". Click it.
4. Click "Submit".
5. ????
6. PROFIT!
Do this for both posts and post again so that I know you did it.
Congratulations. You are now a productive member of this forum.
Hi everybody!
This is my code, all work except delete function.
I check it for several times but can't understand what is problem.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
//Binary Search Tree Program

#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;

class Map
{
//private:
public:
struct tree_node
{
tree_node* left;
tree_node* right;
double data;
char * key;
};
tree_node* root;

//public:
Map()
{
root = NULL;
}

bool isEmpty() const { return root==NULL; }
void print_inorder();
void inorder(tree_node*);
//void print_preorder();
//void preorder(tree_node*);
//void print_postorder();
//void postorder(tree_node*);
void find(char * ch);
//void clear();
//operator[]()
void insert(char * ch, double d);
void remove(char * dkey);
};

// Smaller elements go left
// larger elements go right

void Map::find(char * ch)
{
bool isfind = false;
tree_node* curr;
curr = root;
while(curr)
{
if(strcmp(ch, curr->key)==0)
{
cout << "Suwestvuyet\n";
isfind = true;
break;
}
else if(strcmp(ch, curr->key)>0)
curr = curr->right;
else if(strcmp(ch, curr->key)<0)
curr = curr->left;
}

if(!isfind)
cout << "Ne suwestvuyet\n";
}

void Map::insert(char * ch, double d)
{
tree_node* t = new tree_node;
tree_node* parent;
t->key = ch;
t->data = d;
t->left = NULL;
t->right = NULL;
parent = NULL;

// is this a new tree?
if(isEmpty()) 
root = t;
else
{
//Note: ALL insertions are as leaf nodes
tree_node* curr;
curr = root;
// Find the Node's parent
while(curr)
{
parent = curr;
if(strcmp(t->key, curr->key)) 
curr = curr->right;
else 
curr = curr->left;
}

if(strcmp(t->key, parent->key))
parent->right = t;
else
parent->left = t;
}
}

void Map::remove(char * dkey)
{
//Locate the element
bool found = false;
if(isEmpty())
{
cout<<" This Tree is empty! "<<endl;
return;
}

tree_node* curr;
tree_node* parent;
curr = root;

while(curr)
{
if(strcmp(curr->key,dkey)==0)
{
found = true;
break;
}
else
{
parent = curr;
if(strcmp(curr->key, dkey))
curr = curr->right;
else 
curr = curr->left;
}
}
if(!found)
{
cout<<" Data not found! "<<endl;
return;
}


// 3 cases :
// 1. We're removing a leaf node
// 2. We're removing a node with a single child
// 3. we're removing a node with 2 children

// Node with single child
if((curr->left == NULL && curr->right != NULL)|| (curr->left != NULL
&& curr->right == NULL))
{
if(curr->left == NULL && curr->right != NULL)
{
if(parent->left == curr)
{
parent->left = curr->right;
delete curr;
}
else
{
parent->right = curr->right;
delete curr;
}
}
else // left child present, no right child
{
if(parent->left == curr)
{
parent->left = curr->left;
delete curr;
}
else
{
parent->right = curr->left;
delete curr;
}
}
return;
}

//We're looking at a leaf node
if( curr->left == NULL && curr->right == NULL)
{
if(parent->left == curr)//////////error///////////////////
parent->left = NULL;
else 
parent->right = NULL;
delete curr;
return;
}


//Node with 2 children
// replace node with smallest value in right subtree
if (curr->left != NULL && curr->right != NULL)
{
tree_node* chkr;
chkr = curr->right;
if((chkr->left == NULL) && (chkr->right == NULL))
{
curr = chkr;
delete chkr;
curr->right = NULL;
}
else // right child has children
{
//if the node's right child has a left child
// Move all the way down left to locate smallest element

if((curr->right)->left != NULL)
{
tree_node* lcurr;
tree_node* lcurrp;
lcurrp = curr->right;
lcurr = (curr->right)->left;
while(lcurr->left != NULL)
{
lcurrp = lcurr;
lcurr = lcurr->left;
}
curr->key = lcurr->key;
delete lcurr;
lcurrp->left = NULL;
}
else
{
tree_node* tmp;
tmp = curr->right;
curr->key = tmp->key;
curr->right = tmp->right;
delete tmp;
}

}
return;
}

}


void Map::print_inorder()
{
inorder(root);
}

void Map::inorder(tree_node* p)
{
if(p != NULL)
{
if(p->left) inorder(p->left);
cout <<" Salary[\""<<p->key <<"\"]="; cout <<p->data<<endl;
if(p->right) inorder(p->right);
}
else return;
}

int main()
{
Map salary;
string temp, ftarget, dtarget;
int ch,tmp,tmp1,size;
double data;
while(1)
{
cout<<endl<<endl;
cout<<" Binary Search Tree Operations "<<endl;
cout<<" ----------------------------- "<<endl;
cout<<" 1. Insertion/Creation "<<endl;
cout<<" 2. Print "<<endl;
cout<<" 7. Find "<<endl;
cout<<" 5. Removal "<<endl;
cout<<" 6. Exit "<<endl;
cout<<" Enter your choice : ";
cin>>ch;
char * pch;
switch(ch)
{
case 1 : cout<<" Enter key: ";
cin>>temp;
pch = (char *) malloc(sizeof(char)*temp.size()); 
strcpy(pch, temp.c_str());
cout << " Enter data:";
cin >> data;
salary.insert(pch,data);
break;
case 2 : cout<<endl;
cout<<" In-Order Traversal "<<endl;
cout<<" -------------------"<<endl;
salary.print_inorder();
break;

case 7: cout << "Enter key: ";
cin >> temp;
pch = (char *) malloc(sizeof(char)*temp.size()); 
strcpy(pch, temp.c_str());
salary.find(pch);
break;




/*case 3 : cout<<endl;
cout<<" Pre-Order Traversal "<<endl;
cout<<" -------------------"<<endl;
b.print_preorder();
break;
case 4 : cout<<endl;
cout<<" Post-Order Traversal "<<endl;
cout<<" --------------------"<<endl;
b.print_postorder();
break;*/
case 5 : cout<<" Enter key to be deleted : ";
cin >> temp;
pch = (char *) malloc(sizeof(char)*temp.size()); 
strcpy(pch, temp.c_str());
salary.remove(pch);


break;


}
}
}
Yes, very nice. Now try to do it while keeping the indentation. That's the whole point of [code] tags, not the pretty colors!
Helios,
Here you go...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;


class Map
{
//private:
public:
    struct tree_node
    {
        tree_node* left;
        tree_node* right;
        double data;
        char * key;
    };
    tree_node* root;

//public:
    Map()
    {
        root = NULL;
    }

    bool isEmpty() const { return root==NULL; }
    void print_inorder();
    void inorder(tree_node*);
    //void print_preorder();
    //void preorder(tree_node*);
    //void print_postorder();
    //void postorder(tree_node*);
    void find(char * ch);
    //void clear();
    //operator[]()
    void insert(char * ch, double d);
    void remove(char * dkey);
};

// Smaller elements go left
// larger elements go right

void Map::find(char * ch)
{
    bool isfind = false;
    tree_node* curr;
    curr = root;
    while(curr)
    {
        if(strcmp(ch, curr->key)==0)
        {
            cout << "Suwestvuyet\n";
            isfind = true;
            break;
        }
        else if(strcmp(ch, curr->key)>0)
            curr = curr->right;
        else if(strcmp(ch, curr->key)<0)
            curr = curr->left;
    }

    if(!isfind)
        cout << "Ne suwestvuyet\n";
}

void Map::insert(char * ch, double d)
{
    tree_node* t = new tree_node;
    tree_node* parent;
    t->key = ch;
    t->data = d;
    t->left = NULL;
    t->right = NULL;
    parent = NULL;

    // is this a new tree?
    if(isEmpty()) 
        root = t;
    else
    {
        //Note: ALL insertions are as leaf nodes
        tree_node* curr;
        curr = root;
        // Find the Node's parent
        while(curr)
        {
            parent = curr;
            if(strcmp(t->key, curr->key)) 
                curr = curr->right;
            else 
                curr = curr->left;
        }

        if(strcmp(t->key, parent->key))
            parent->right = t;
        else
            parent->left = t;
    }
}

void Map::remove(char * dkey)
{
    //Locate the element
    bool found = false;
    if(isEmpty())
    {
        cout<<" This Tree is empty! "<<endl;
        return;
    }

    tree_node* curr;
    tree_node* parent;
    curr = root;

    while(curr)
    {
        if(strcmp(curr->key,dkey)==0)
        {
            found = true;
            break;
        }
        else
        {
            parent = curr;
            if(strcmp(curr->key, dkey))
                curr = curr->right;
            else 
                curr = curr->left;
        }
    }
    if(!found)
    {
        cout<<" Data not found! "<<endl;
        return;
    }


    // 3 cases :
    // 1. We're removing a leaf node
    // 2. We're removing a node with a single child
    // 3. we're removing a node with 2 children

    // Node with single child
    if((curr->left == NULL && curr->right != NULL)|| (curr->left != NULL && curr->right == NULL))
    {
        if(curr->left == NULL && curr->right != NULL)
        {
            if(parent->left == curr)
            {
                parent->left = curr->right;
                delete curr;
            }
            else
            {
                parent->right = curr->right;
                delete curr;
            }
        }
        else // left child present, no right child
        {
            if(parent->left == curr)
            {
                parent->left = curr->left;
                delete curr;
            }
            else
            {
                parent->right = curr->left;
                delete curr;
            }
        }
        return;
    }

    //We're looking at a leaf node
    if( curr->left == NULL && curr->right == NULL)
    {
        if(parent->left == curr)//////////error///////////////////
            parent->left = NULL;
        else 
            parent->right = NULL;
        delete curr;
        return;
    }


    //Node with 2 children
    // replace node with smallest value in right subtree
    if (curr->left != NULL && curr->right != NULL)
    {
        tree_node* chkr;
        chkr = curr->right;
        if((chkr->left == NULL) && (chkr->right == NULL))
        {
            curr = chkr;
            delete chkr;
            curr->right = NULL;
        }
        else // right child has children
        {
            //if the node's right child has a left child
            // Move all the way down left to locate smallest element

            if((curr->right)->left != NULL)
            {
                tree_node* lcurr;
                tree_node* lcurrp;
                lcurrp = curr->right;
                lcurr = (curr->right)->left;
                while(lcurr->left != NULL)
                {
                    lcurrp = lcurr;
                    lcurr = lcurr->left;
                }
                curr->key = lcurr->key;
                delete lcurr;
                lcurrp->left = NULL;
            }
            else
            {
                tree_node* tmp;
                tmp = curr->right;
                curr->key = tmp->key;
                curr->right = tmp->right;
                delete tmp;
            }

        }
        return;
    }

}


void Map::print_inorder()
{
    inorder(root);
}

void Map::inorder(tree_node* p)
{
    if(p != NULL)
    {
        if(p->left) inorder(p->left);
            cout <<" Salary[\""<<p->key <<"\"]="; cout <<p->data<<endl;
        if(p->right) inorder(p->right);
    }
    else return;
}


int main()
{
	Map salary;
    string temp, ftarget, dtarget;
    int ch,tmp,tmp1,size;
    double data;
    while(1)
    {
        cout<<endl<<endl;
        cout<<" Binary Search Tree Operations "<<endl;
        cout<<" ----------------------------- "<<endl;
        cout<<" 1. Insertion/Creation "<<endl;
        cout<<" 2. Print "<<endl;
        cout<<" 7. Find "<<endl;
        cout<<" 5. Removal "<<endl;
        cout<<" 6. Exit "<<endl;
        cout<<" Enter your choice : ";
        cin>>ch;
        char * pch;
        switch(ch)
        {
            case 1 : cout<<" Enter key: ";
                cin>>temp;
                pch = (char *) malloc(sizeof(char)*temp.size()); 
                strcpy(pch, temp.c_str());
                cout << " Enter data:";
                cin >> data;
                salary.insert(pch,data);
                break;
            case 2 : cout<<endl;
                cout<<" In-Order Traversal "<<endl;
                cout<<" -------------------"<<endl;
                salary.print_inorder();
                break;

            case 7: cout << "Enter key: ";
                cin >> temp;
                pch = (char *) malloc(sizeof(char)*temp.size()); 
                strcpy(pch, temp.c_str());
                salary.find(pch);
                break;

            /*case 3 : cout<<endl;
                cout<<" Pre-Order Traversal "<<endl;
                cout<<" -------------------"<<endl;
                b.print_preorder();
                break;
            case 4 : cout<<endl;
                cout<<" Post-Order Traversal "<<endl;
                cout<<" --------------------"<<endl;
                b.print_postorder();
                break;*/
            case 5 : cout<<" Enter key to be deleted : ";
                cin >> temp;
                pch = (char *) malloc(sizeof(char)*temp.size()); 
                strcpy(pch, temp.c_str());
                salary.remove(pch);
                break;
        }
    }

    return 0;
}


akmal4ik,
It looks like tree_node* parent; on line 112 can be used without being initialsed.
Last edited on
Oh, would you remind me the name of that program? I can never remember it.
Topic archived. No new replies allowed.