Because 500 is not an address.
Doing this:
int* ptr = new int;
...
ptr = 500;
Doesn't set the integer value, it sets the pointer to the integer value - i.e. it throws away the address of the integer, and replaces it with the value 500.
And that useless to you, because it's not an address. So when you try to print it later it tries to print the address and basically throws up it's hands in horror.
Probably what you meant to do was this:
int* ptr = new int;
...
*ptr = 500;
...
cout << "PTR = " << *ptr << endl << " VAL = " << val << endl << endl;