You need to cast to void*
to invoke correct overload of operator <<
instead of outputting as C strings
std::cout << static_cast<void*>(c) << std::endl;
std::cout << static_cast<void*>(c+3) << std::endl;
More Related Contents:
- How to change mode from c++98 mode in Dev-C++ to a mode that supports C++0x (range based for)?
- Copy constructor for a class with unique_ptr
- What is constructor inheritance?
- How to call a function on all variadic template args?
- std::array vs array performance
- How to enable C++11 in Qt Creator?
- when g++ static link pthread, cause Segmentation fault, why?
- How to give priority to privileged thread in mutex locking?
- How to use sfinae for selecting constructors?
- std::thread is not a member of namespace std using Eclipse Kepler MinGW
- What is the difference between std::reference_wrapper and a simple pointer?
- Which cannot be implemented without compiler hooks?
- Should I delete the move constructor and the move assignment of a smart pointer?
- How can I iterate over a packed variadic template argument list?
- What is the value category of the operands of C++ operators when unspecified?
- False positive with is_copy_constructible on vector
- Concat two `const char` string literals
- Is left-shifting (
- When to make a type non-movable in C++11?
- Why does using a temporary object in the range-based for initializer result in a crash?
- std::remove_if – lambda, not removing anything from the collection
- Why can’t std::ostream be moved?
- Overload resolution: assignment of empty braces
- gcc can compile a variadic template while clang cannot
- What does static_assert do, and what would you use it for?
- Constructor as a function try block – Exception aborts program
- Is it always the case that sizeof(T) >= alignof(T) for all object types T?
- Converting steady_clock::time_point to time_t
- C++ view types: pass by const& or by value?
- Overload resolution with ref-qualifiers