Click here to Skip to main content
12,695,076 members (34,241 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ C
I have made this program for my assignment plzz check this and correct the errors i have to submit it latest by 12:00am


struct node
    int element;
    struct node* left;
    struct node* right;

typedef struct node* ptrtonode;
typedef ptrtonode searchtree;
typedef ptrtonode position;
struct treenode
    int Element;
    treenode *Left;
    treenode *Right;

typedef struct treenode *PtrToNode;
typedef struct *PtrToNode searchtree;
typedef struct *PtrToNode Position;

searchtree tree(int x,searchtree T);
void preorder(searchtree T);


searchtree tree(int x,searchtree T);
void preorder(searchtree T);

int main()
    int T=NULL;
    //  freopen("out.txt","w",stdout);
    int  c,i=0;
    int array[100];
    return 0;

searchtree tree(int x,searchtree T)

    //searchtree T;
        T=malloc(sizeof(struct node));
void preorder(searchtree T)

Posted 10-Dec-12 3:55am
Updated 10-Dec-12 5:38am
Alan N 10-Dec-12 9:01am
Sorry mate you're too late. It's already 1400 here! On a more serious note, why not test your code and see if it performs as expected.
Member 9505466 10-Dec-12 9:10am
i tried my best to do plzz help me out of this !
Richard MacCutchan 10-Dec-12 9:28am
How can we check it when we don't know what it is supposed to do? Try building it so you can at least fix the basic errors.
nv3 10-Dec-12 9:29am
If you have already problems with an easy assignment like this, what will you do when you will be working on real software?
Sergey Alexandrovich Kryukov 10-Dec-12 17:11pm
No; it's not very likely that anyone would look at your code before you explain what you tried to achieve, what it was supposed to do, what did you observer instead and why do you think this behavior is wrong.

Also, did you execute it under debugger?
joshrduncan2012 10-Dec-12 9:13am
You need to show some effort as to debugging before we can help you. We will not do the work for you.
OriginalGriff 10-Dec-12 9:34am
We do not know what it is supposed to do, much less how well it does it!
But, a few quick bits:
1) Take out commented-out code - if it's if not used, it doesn't belong in there.
2) Comment your code! Functions need headers to describe them, and the code within them needs explanation.
3) Don't use single character variable names - use meaningful names that describe what you use the variable for.
4) "else" means just that. So you don't need to say:
if (a == b) { ... }
if (a != b) {...}
because the second condition is implied by the else.
if (a == b) { ... }
else {...}
Is clearer, and less code.
ryanb31 10-Dec-12 10:49am
What are the errors?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Have a lot of problem~~~

check syntax problem at first.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100