Returning more than one variable? - Help

From: ali (tj_at_raha.com)
Date: 09/23/04


Date: Thu, 23 Sep 2004 01:40:20 -0400

Hi,

I have a function, which is going to dynamically create memory
allocation for an integer array using...

 int *list = (int*)malloc(5*sizeof(int));

Within the same function, I have created another array dynamically,
with the same size element, and same contents, but sorted.. Hence,

int *AscList = (int*) malloc(5 * sizeof(int));

The function then returns list to the caller (in my case, main( ) ).

The problems I want to return list and AscList. Will appreciate if
somoene helped me out with the function prototype, and how i can use
it in the main function. Unfortunately, I'm not very conversant with
references and pointers.

Thanks,

Ali



Relevant Pages