hi!
I think my code is getting a little bit messy.
I started building my ownlittle tree with soem structures:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
typedefstruct{//branches
char name;
void *where;
}branch;
typedefstruct{//node
void *back;
branch *branches;
int branchsize;
int number;
}node;
[...]
int pos;
node* thenode;
[...]
if(((*((node*)((((*thenode).branches)[pos]).where))).branches)!=NULL){
[...]
(I ommited the non essential parts)
that if looks kinda NOT GOOD to me.
any advice on cleaning that mess a bit?
(I'm not sure about the operator prioritys so i used () everywhere, wich messes that up even more. at least help me remove some unnecessary brakets.
nope I'm coding a wierd tree wich can have as many branches per node as I need.
and as most will propably have 1 or 2, but it can get up to 30, i decided to put the branches into a branch* and malloc them whenever a new branche is added to a node.