You can cast it to an intptr_t
type. It’s an int
type guaranteed to be big enough to contain a pointer. Use #include <cstdint>
to define it.
More Related Contents:
- Is it safe to delete a void pointer?
- casting via void* instead of using reinterpret_cast [duplicate]
- Why it is so ? And It is without you explicitly do casting [duplicate]
- When should static_cast, dynamic_cast, const_cast and reinterpret_cast be used?
- Implicit type conversion rules in C++ operators
- When to use reinterpret_cast?
- dynamic_cast and static_cast in C++
- How is a variable at the same address producing 2 different values? [duplicate]
- What is the difference between (type)value and type(value)?
- What exactly is a type cast in C/C++?
- Efficient unsigned-to-signed cast avoiding implementation-defined behavior
- Should I worry about the alignment during pointer casting?
- Reinterpret_cast vs. C-style cast
- Implicit conversion from char** to const char**
- Weird Behaviour with const_cast [duplicate]
- Can a cast operator be explicit?
- Difference in behavior while using dynamic_cast with reference and pointers
- Casting int to bool in C/C++
- What is the difference between C-like casting and functional casting? [duplicate]
- What exactly is or was the purpose of C++ function-style casts?
- What does “void *(*)(void *)” mean in C++?
- dynamic_cast from “void *”
- Why cast a pointer to a float into a pointer to a long, then dereference?
- What is a void pointer in C++? [duplicate]
- Performance hit from C++ style casts?
- can void* be used to store function pointers? [duplicate]
- C++: Why is const_cast evil?
- Purpose of a “.f” appended to a number?
- Why Doesn’t reinterpret_cast Force copy_n for Casts between Same-Sized Types?
- How can I extend a lexical cast to support enumerated types?