According to the specification, the effect of dereferencing an invalid pointer itself produces undefined behaviour. It doesn’t matter what you do after dereferencing it.
More Related Contents:
- C++ pointer decleration
- What is a smart pointer and when should I use one?
- C++ delete – It deletes my objects but I can still access the data?
- Why doesn’t polymorphism work without pointers/references?
- C/C++: Pointer Arithmetic
- What is the point of function pointers?
- How does delete[] know it’s an array?
- Why is ‘this’ a pointer and not a reference?
- Pointers, smart pointers or shared pointers? [duplicate]
- What makes more sense – char* string or char *string? [duplicate]
- Modifying a const through a non-const pointer
- Why does streaming a char pointer to cout not print an address?
- When should I use raw pointers over smart pointers?
- Deleting a pointer in C++
- Should I store entire objects, or pointers to objects in containers?
- error: invalid initialization of non-const reference of type ‘int&’ from an rvalue of type ‘int’
- C++ correct way to return pointer to array from function
- Store an int in a char array?
- C++ typedef interpretation of const pointers
- Modifying a const int in C++ [duplicate]
- Difference between using character pointers and character arrays
- Function pointer as parameter
- Are non dereferenced iterators past the “one past-the-end” iterator of an array undefined behavior?
- How do I create an array of pointers?
- Const variable changed with pointer in C
- What does ‘**’ mean in C?
- Assign a string literal to a char* [duplicate]
- Can I call memcpy() and memmove() with “number of bytes” set to zero?
- Displaying the address of a string
- Both asterisk and ampersand in a parameter