I have been confused about displaying the address of a dynamic integer. When I output ptr and &ptr I receive two different addresses, however I am unsure about which address is correctly pointing to the value of the pointer.
int main()
{
//Setting pointer to null.
int *ptr = NULL;
ptr = new int;
*ptr = 10;
//Displaying value the pointer is pointing to, and the address.
cout << "Value pointing to : " << *ptr << endl;
cout << "Address : " << ptr << endl;