Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int main()
- {
- int* pt = new int;
- *pt = 1001;
- cout << "int";
- cout << "value = " << *pt << ";location = " << pt << endl;
- double *pd = new double;
- *pt = 10000001;
- cout << "double";
- cout << "value = " << *pd << ";location = " << pd << endl;
- cout << "size of pt = " << sizeof(pt) << endl;
- cout << "size of *pt = " << sizeof(*pt) << endl;
- cout << "size of pd = " << sizeof(pd) << endl;
- cout << "size of *pd = " << sizeof(*pd) << endl;
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement