The meaning of the word generic
Hello all, I've got several questions and I'm sure you'll find them
easy to answer, but sadly I don't know the answers though:
What do people mean by generic pointers
Why is a pointer to void generic
Why would someone need pointers to void?
Re: The meaning of the word generic
> What do people mean by generic pointers
A pointer to an area of memory (if generic data pointer, rather than
function pointer) that may be used for different purposes.
> Why is a pointer to void generic
Because it doesn't point to a specific type of data, but can be
converted to a pointer to any data type.
> Why would someone need pointers to void?
One example is a pointer to the memory returned by malloc(). malloc()
doesn't know or care what the memory will be used for. It returns a
generic pointer that has type void*. Another example is the array
argument passed to qsort().
|All times are GMT. The time now is 12:42 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.