Possible Duplicate:
returning multiple values from a function
I'm trying to make a doubly linked list in C. I have a main function that calls another function to create nodes and build the list. I need this last function to return two different pointers (one to the start and one to the end of the list) to main. Is there a way to use "return" to return two things? In this case two pointers. I thought in returning a structure with two elements, the two pointers. But is there an easy way?
This is how I call the function (insertacomienzo) in the main:
primero = insertacomienzo (primero, ultimo, tamaniomax);
(primero is a pointer) And the function returns this pointer now modified.
return primero;
What I need is to return now two pointers, one is the one pointing to the start of the list, and the other is pointing to the end of the list.
Thank you!