How does the function work? |
Since you are only showing us the
signature of the function,
not the actual implementation (code, or function body), it is impossible to know what the function does and how.
You can think of an
untyped void* pointer as a memory address, but
no information
what is at that address.
Conversely, a
typed int* pointer would be the address of an
int value (supposedly).
Anyhow, a typical example of a function that takes
untyped void* pointers would be
memcpy():
void * memcpy(void * destination, const void * source, size_t num);
https://www.cplusplus.com/reference/cstring/memcpy/
memcpy() doesn't care about the type of the data to be copied, it just copies the data in a "byte by byte" fashion, so
void* is okay here. And it's the most "general" pointer type, so
memcpy() can work with
any data without the need for scary type casts. But, as you see,
memcpy() also needs a "num" argument, so that it can know how many bytes to copy. It couldn't know that from the pointer type, because... the pointer is untyped.