Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   link list (http://www.go4expert.com/forums/link-list-t9667/)

answerme 31Mar2008 19:58

link list
Below code is for inserting data to the front of the node ,just wanted to know we have reassigned start = tmp ,i.e. start will point to the inserted node which is now new first node but how


int add_begin(int data)
                        struct node *tmp;
                        tmp=malloc(sizeof(struct node));
                        tmp->info=data;// put data
                        tmp->link=start;// point to nxt node
                        start=tmp; // start will point to inserted node

All times are GMT +5.5. The time now is 20:37.