CrazyDoctor Posted June 6, 2010 Posted June 6, 2010 Hi All,I have some troubles with implementing a function that printing the linked list.This is the struct:typedef struct item{ int data; struct item* next;} sItem;I need to implement this:void print_list(sItem* head)How do I do that?Many Thanks!
Mijzelf Posted June 7, 2010 Posted June 7, 2010 (edited) Assuming the last 'next' member is zero:void print_list(sItem* head){ for( ; head; head=head->next ) { printf( "%d\n", head->data ); }} Edited June 7, 2010 by Mijzelf
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now