Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int* pt = new int;
  6. *pt = 1001;
  7. cout << "int";
  8. cout << "value = " << *pt << ";location = " << pt << endl;
  9. double *pd = new double;
  10. *pt = 10000001;
  11. cout << "double";
  12. cout << "value = " << *pd << ";location = " << pd << endl;
  13. cout << "size of pt = " << sizeof(pt) << endl;
  14. cout << "size of *pt = " << sizeof(*pt) << endl;
  15. cout << "size of pd = " << sizeof(pd) << endl;
  16. cout << "size of *pd = " << sizeof(*pd) << endl;
  17. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement