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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now