Re: The meaning of the word generic
- From: Thad Smith <ThadSmith@xxxxxxx>
- Date: Sat, 31 Dec 2005 00:55:54 -0700
Albert wrote:
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().
-- Thad .
- References:
- The meaning of the word generic
- From: Albert
- The meaning of the word generic
- Prev by Date: Re: How to stop reading a file?
- Next by Date: Re: void * pointer convert problem.
- Previous by thread: The meaning of the word generic
- Next by thread: Adding the ability to add functions into structures?
- Index(es):
Relevant Pages
|