pointer to void property
Given the following:
int a = 10;
int *p;
void *p1;
unsigned char *p2;
p = &a;
p1 = p;
p2 = p1;
is a guarantee made that I can access the object representation
via 'p2'?
Will the value assigned between different pointer to object types
through use of a generic pointer preserve this value?
I know it is guaranteed to be preserved if it is assigned from a
pointer to an object type to a void pointer and back again to said
pointer to object type. But will the value assigned between different
pointer to object types through use of a generic pointer, preserve this
value?
--
aegis
.
Relevant Pages
- Re: function prototype vs function declaration
... Types are partitioned into object types, function types, and incomplete types." ... apply to types derived from the base types, including pointer types. ... Then a pointer to T is an object type, not an incomplete type: ... (comp.lang.c) - Re: (const char *cp) and (char *p) are consistent type, (const char **cpp) and (char **pp) are not c
... char pointer and const char pointer are both pointers to the same object ... A const char pointer and char pointer are different object types, ... In this context, a void* is just another object type, and a void** is ... (comp.lang.c) - Re: When will the typePtr of a Tcl_Obj be set correctely?
... >#> all argument object types will be lost? ... >apparently destroys the pointer, but the pointer can be resurrected ... In the above case $c is not an object in the way Tk windows are. ... [Incr Tcl] ... (comp.lang.tcl) - Re: standard memory allocator alignment issue...
... One thing I might do is write my own memory allocator. ... once to get a big chunk of memory, ... guarantee that the pointers returned by my_malloc are properly ... can't see a way to adjust a pointer using it in any potable way. ... (comp.lang.c) - Re: Boolean Buyers Beware ... AIX compiler bug --- PMR 26241,756
... The quintessential example of what I'm talking about is the pointer you get back from 'malloc'. ... You've made a whole bunch of assertions on this thread with no ... where you get to size your buckets. ... Just use Google Code search for "guarantee", ... (comp.programming.threads) |
|