Top "Dangling-pointer" questions

Dangling pointers and wild pointers in computer programming are pointers that do not point to a valid object of the appropriate type.

Can a local variable's memory be accessed outside its scope?

I have the following code. #include <iostream> int * foo() { int a = 5; return &a; } int main() { int* p = …

c++ memory-management local-variables dangling-pointer
What is the difference between a weak reference and an unowned reference?

Swift has: Strong References Weak References Unowned References How is an unowned reference different from a weak reference? When is …

swift memory-management automatic-ref-counting weak-references dangling-pointer
What is a dangling pointer?

I know this is pretty common question, but still new for me! I don't understand concept of dangling pointer, was …

c++ pointers dangling-pointer
Dangling pointer example

In the following code, why does s1.printVal causes a dangling pointer error? Isn't the s1 object, i.e. its …

c++ dangling-pointer
Dynamically allocated list in C++

I made a cute generic (i.e. template) List class to handle lists in C++. The reason for that is …

c++ list pointers dynamic-memory-allocation dangling-pointer
Is there any way to check if pointer is dangling?

I have a code where I use a pointer to access some datablock. In some rare cases, a few members …

c++ pointers mfc dangling-pointer