On 16 Oct 2011 at 21:10, Dave McGuire wrote:
On 10/16/2011 07:59 PM, Chuck Guzis wrote:
It helps to not think of them as
"pointers", but simply as "memory
addresses". It's just semantics, but it can make one more comfortable
with the idea. The fact is, they're extremely useful, and they work
great. :)
Maybe, but is a void* guaranteed any sort of alignment? Otherwise,
one might as well use an explicit type, such as (unsigned char*) if
that's the addressing granularity intended. Very often, on such
calls, the size of the item in chars is specified, so why not use
that type? One can always cast an int* to a char*, for example.
Yes, I know that stdio.h routines all use void* to point to the
transfer area, when in fact they're really working in chars.
A subtle point, perhaps, but it rankles my language-correctness
conscience.
--Chuck