int *x = new int;
*x = 5;
cout << x << endl;
delete[] x;
I am trying to dynamically allocate resources to a variable 'x'. I then assign the value '5' to it. When I try to print the value of 'x', I get some garbage value called 0x8321 and so on. I am sure that is not the value I assigned.
Any idea how I can access the value of x?