4 ms·
More particularly, I would describe it as a "pointer to anything". The size of the value will be exactly the size used for pointers in the given system (e.g. 8
by Warwolt 4y ago
More particularly, I would describe it as a "pointer to anything". The size of the value will be exactly the size used for pointers in the given system (e.g. 8 bytes).
If you happen to know what a void* is pointing to, you can cast it to another type like "my_struct_t*" and deference the value. I would call it a work around for C lacking true polymorphism.
- quietbritishjim 4y agoThat is pretty much the opposite of what GP said: they're using void* to directly store an integer value rather than a pointer to anything (in that case).