Top "Void-pointers" questions

A void pointer (void *) in C and C++ is a pointer that points to a memory location with no specified type.

Is comparing two void pointers to different objects defined in C++?

Inspired by this answer about dynamic cast to void*: ... bool eqdc(B* b1, B *b2) { return dynamic_cast<void*&…

c++ comparison void-pointers language-lawyer
Generic programming in C

I am writing a generic linked list implementation in pure C. struct Node { void *value; struct Node *next; }; struct LinkedList { …

c generics printf void-pointers generic-programming
When is uintptr_t preferred over intptr_t?

Given the requirement that I need to store the value of a "generic" pointer in a struct and have no …

c pointers void-pointers
Pointer to void in C++?

I'm reading some code in the Ogre3D implementation and I can't understand what a void * type variable means. What …

c++ pointers void void-pointers
Does a pointer point to the LSB or MSB?

if I have the following code: int i = 5; void * ptr = &i; printf("%p", ptr); Will I get the LSB …

c++ c pointers void-pointers
Why is `boost::any` better than `void*`?

What inherent advantages do boost::any and boost::any_cast offer over using void* and dynamic_cast?

c++ boost void-pointers variadic
dereferencing structure from (void *) type

i'm trying to pass data with void pointer and then cast it to (pData *) type. What am i doing wrong? …

c void-pointers
Is there a way to cast shared_ptr<void> to shared_ptr<T>?

I want to keep the smart behavior of std::shared_ptr. So is there a way to cast a shared …

c++ shared-ptr void-pointers reference-counting