![]() |
error in compilation of binary tree code in c
hi,
I have been asked to implement a binary tree structure with the foll requirements 1) Generate 1000 integers from 100,000,001 to 100,001,000 2) Create a collection and add first 500 integers 3) Delete 400 integers from 101st to 500th. 4) Add the rest of 500 integers 5) Find all the odd numbers in the collection and delete all of them. 6) Your inordertraversal function writes all the items in the collection into a file named output3.txt as below. 100000002 100000004 100000006 .... i have written the code with 3 files which are as follows: Code:
////////////////////////////////////////Code:
///////////////////////////////////////////Code:
//////////////////////////////////////////////////////////////ont> gcc -c main.c coll_at.c main.c: In function `InOrderTraversal': main.c:17: error: syntax error before '{' token main.c:20: error: parameter `j' is initialized main.c:22: error: syntax error before "f1" coll_at.c: In function `InOrderTraversal': coll_at.c:13: warning: structure defined inside parms coll_at.c:20: warning: structure defined inside parms coll_at.c:20: warning: empty declaration coll_at.c:23: error: syntax error before ')' token coll_at.c:92: error: syntax error before '*' token |
Re: error in compilation of binary tree code in c
Without even looking at the code after formatting do you expect some one to look into the code and debug it out for you who has not bothered to paste the code in the proper format?
|
Re: error in compilation of binary tree code in c
Determine what you really want here:
Code:
int(*private_print)(void *item) |
Re: error in compilation of binary tree code in c
ok, let me try to put it again
Code:
////////////////////Code:
/////////////////////////////////////Code:
//////////////////////////////////////ont> gcc -c main.c coll_at.c main.c: In function `InOrderTraversal': main.c:15: error: old-style parameter declarations in prototyped function definition main.c:34: error: `ItemCmp' undeclared (first use in this function) main.c:34: error: (Each undeclared identifier is reported only once main.c:34: error: for each function it appears in.) main.c: In function `ItemCmp': main.c:73: warning: assignment makes integer from pointer without a cast main.c:74: warning: assignment makes integer from pointer without a cast main.c: In function `private_print': main.c:85: warning: assignment makes integer from pointer without a cast main.c:88: error: `f1' undeclared (first use in this function) main.c:93: error: syntax error at end of input coll_at.c: In function `InOrderTraversal': coll_at.c:13: warning: structure defined inside parms coll_at.c:20: warning: structure defined inside parms coll_at.c:20: warning: empty declaration coll_at.c:29: error: syntax error before '{' token coll_at.c:92: error: syntax error before '*' token i hope the code is now acceptable for a review thanks a lot |
Re: error in compilation of binary tree code in c
Are you even looking at your own post? :confused: Please follow this link.
|
Re: error in compilation of binary tree code in c
main.c
Code:
#include <assert.h>coll_at.c Code:
#include <stdlib.h> /* calloc */coll_a.h Code:
/* Specification for collection */ont> gcc -c main.c coll_at.c main.c: In function `InOrderTraversal': main.c:15: error: old-style parameter declarations in prototyped function definition main.c:34: error: `ItemCmp' undeclared (first use in this function) main.c:34: error: (Each undeclared identifier is reported only once main.c:34: error: for each function it appears in.) main.c: In function `ItemCmp': main.c:73: warning: assignment makes integer from pointer without a cast main.c:74: warning: assignment makes integer from pointer without a cast main.c: In function `private_print': main.c:85: warning: assignment makes integer from pointer without a cast main.c:88: error: `f1' undeclared (first use in this function) main.c:93: error: syntax error at end of input coll_at.c: In function `InOrderTraversal': coll_at.c:13: warning: structure defined inside parms coll_at.c:20: warning: structure defined inside parms coll_at.c:20: warning: empty declaration coll_at.c:29: error: syntax error before '{' token coll_at.c:92: error: syntax error before '*' token |
Re: error in compilation of binary tree code in c
Quote:
|
Re: error in compilation of binary tree code in c
What happened. does nobody have a clue about this?
|
Re: error in compilation of binary tree code in c
You appear to be the one that is clueless. Because your code is not indented, I won't look at it. I did look at the messages and give you a tip, which you seem to be ignoring. I'll give you one more, then I expect you to help us help you by presenting decently formatted code. This is wrong:
Code:
int main(); |
Re: error in compilation of binary tree code in c
Quote:
|
| All times are GMT +5.5. The time now is 02:29. |