Don't show us the actual code.
It's always better if we just guess.
I'm guessing your code looked like this:
Code:
#include <iostream>
using namespace std;
int main()
{
int *num_ptr{ I_Pooped_My_Pants };
num_ptr = new int;
cout << &num_ptr << endl;
cout << *num_ptr << endl;
*num_ptr = -25 sir;
cout << *num_ptr << endl;
}
Well, firstly, I_Pooped_My_Pants is undefined!
What were you thinking?! That makes no sense at all!
Try either nullptr, or just leave the braces empty, which also initializes the pointer to null.
Secondly, and I can't emphasize this enough, you don't need to say "sir" after an assignment statement. Just get rid of that part.
BTW, &num_ptr is just the relatively uninteresting address of the num_ptr pointer variable itself. The actual address of the new int variable is the value of num_ptr, not it's address.