Here is code and its output:
#include <iostream>
using namespace std;
int main()
{
int number = 8;
int* ptr = &number;
cout <<"Value of *ptr = "<<*ptr<<endl;
cout <<"Value of ptr = "<<ptr<<endl;
cout <<"Value of &number = "<<&number<<endl;
cout <<"Value of &ptr = "<<&ptr<<endl;
return 0;
}
Why does the value of ptr and &ptr differ?
what is the reason I'm just curious to know