struct m_b_e{ int a; struct m_b_e *next;};struct tree{ int b; struct m_b_e *block_list;};and function declarations .. void func(struct tree*);void func_in(struct tree*);definations .. void func(struct tree *p){ struct m_b_e *c,*d; printf("func..\n"); if(!p)  return; for(c=p->block_list;c;c=d) {  d = c->next;  free(c); } func_in(p);}void func_in(struct tree *p){ printf("inner most function\n");}And,           pointer p is being passed to func. So, i am trying to fill in some value for pointer after allocating memory.  int main(){ int i; struct tree *p,*q; q= NULL; for(i = 1;iblock_list->a= i;   // Problem here.. How to assign a value here. ?   p->block_list = p->block_list->next; // How to move to next node.?   }p->block_list->next = NULL; func(p);  // pointer p is passed here. So, i need to have value in p. return(0);}
Member Avatar for iamthwee

You got the code tags wrong.

commented: It's an epidemic - Salem +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.