If you want client code to manipulate the list, you need to define type C, for example:
struct Node { int foo; float bar;
and return the pointer to the head of the list:
struct Node* getData();
Which basically means that you will need to copy the contents of your std::list into a data structure of type C if you want client code to manipulate the list.
Otherwise, you can copy the contents of your std::list to an adjacent memory block, return this block to the caller, but in this case, the caller is responsible to free the memory. Returning the array also means that memory cleaning should be done using a function compatible with the function that you used to allocate the block: your implementation will most likely use malloc rather than new to allocate this block, so that the caller can later use free on block.
Gregory Pakosz
source share