ive seen functions passing pointers in their parameters and they are common in dynamic use executing different functions after afew steps. However i came across this representation in a header file:
void *allocate_mem(u_int32_t n);
Any clue to how it is to be used? Is the function a pointer or does it return a pointer?
See my comments.
Please use cdecl.org whenever you have questions like this… entering
void *allocate_mem(u_int32_t), we get the following.So, we know
allocate_memreturnsvoid *. Now, you’re probably wondering why you would ever want a pointer tovoid…§6.3.2.3.1 of the C99 standard states as follows.
Thus you can convert the result of
allocate_memto fit your needs, e.g.