Linked Questions

0 votes
2 answers
5k views

I have written following array pointer program in C++. I have deleted the pointer, but i am not able to confirm whether the pointer is deleted or not. Thanks in advance! #include<iostream> ...
Anupriya Patil's user avatar
-1 votes
1 answer
307 views

I was reading C++ Is it possible to determine whether a pointer points to a valid object? and the correct answer in this thread is that no, you can't do that, but the thread is quite old now and I ...
r3k0j's user avatar
  • 187
-2 votes
1 answer
689 views

I wrote the following function: template <typename T> void SetPointer(DWORD64 base, vector<DWORD>Offsets, T value){ base = *reinterpret_cast<DWORD64*>(base); for (int i = 0; i < ...
Talococh's user avatar
-1 votes
6 answers
2k views

Is there anyone show me how to check my pointer is pointing to an invalid memory address. #include<iostream> class Node{ public: int data; Node * next , * prev; }; // Driver Code int ...
zain ul din's user avatar
1 vote
2 answers
271 views

May be this is very dumb question. But I don't know answer to this. If object to which pointer is referring is deleted by someone( we don't know who is deleting it ), but I still have raw pointer to ...
Kailas's user avatar
  • 837
1 vote
0 answers
58 views

I was given an integer pointer (passed through a function) which I can't modify that can possibly point to invalid memory or is a zero-pointer. I need to know if there's a way to check whether or not ...
TheCo's user avatar
  • 51
0 votes
0 answers
47 views

in my little example I have created an array of the size 5 and added 3 car pointers to it. So there are 2 slots unfilled. Question: How is it possible to find out how many pointers to cars are valid ( ...
HKC72's user avatar
  • 532
103 votes
29 answers
116k views

Is there any way to determine (programatically, of course) if a given pointer is "valid"? Checking for NULL is easy, but what about things like 0x00001234? When trying to dereference this kind of ...
noamtm's user avatar
  • 13.1k
189 votes
6 answers
92k views

How much is the overhead of smart pointers compared to normal pointers in C++11? In other words, is my code going to be slower if I use smart pointers, and if so, how much slower? Specifically, I'm ...
Venemo's user avatar
  • 19.2k
0 votes
1 answer
2k views

My idea is to print the object it points to. I think a valid pointer should have a valid object. If we try to print out the object we verify if the pointer is valid. Am I right?
jsh6303's user avatar
  • 2,040
2 votes
3 answers
891 views

I'm working with visual studio IDE, I need to break my program at a particular place if a pointer at the same line pointing to a invalid memory (already deleted memory). is there a way to do that?
Nayana Adassuriya's user avatar
2 votes
1 answer
1k views

I have been given an interview question to write a Memory Manager (memory pool). I am almost done, but I have problems with deallocating. It is also fine to ask for help, as along as we mention the ...
Sasan's user avatar
  • 35
0 votes
1 answer
358 views

I would like to determine if there is a way to determine whether a dynamically allocated matrix is square (nxn). The first thing that came to mind was to see if there is a way to find out whether a ...
omri's user avatar
  • 425
-1 votes
1 answer
92 views

I am currently doing some dynamic programming in C++ using QT creator. Is there a way to know if a piece of memory that I allocated dynamically is emptied out at the end of a function? EDIT: I am ...
Alperen AYDIN's user avatar