I'm very new in C and right now I'm stuck with a simple problem. I want to retrieve the i'th element of the list and I have the following API. The argument 'sp' specifies the pointer to the variable into which the size of the region of the return value is assigned.
const void *tclistval(const TCLIST *list, int index, int *sp);
The list contains uint64_t values. How do I retrieve the i'th element?
P.S. More details about that function:
The return value is the pointer to the region of the value. Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string. if 'index' is equal to or more than the number of elements, the return value is 'NULL'.