-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuse_new.cpp
More file actions
26 lines (22 loc) · 740 Bytes
/
Copy pathuse_new.cpp
File metadata and controls
26 lines (22 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int nights = 1001;
int *pt = new int;
*pt = 1001;
cout << "nights value = ";
cout << nights << ": location " << &nights << endl;
cout << "int ";
cout << "value = " << *pt << ":location = " << pt << endl;
double *pd = new double;
*pd = 1000001.1;
cout << "double ";
cout << "value = " << *pd << ": location = " << pd << endl;
cout << "location of pointer pd: " << &pd << endl;
cout << "size of pt = " << sizeof(pt);
cout << ": size of *pt = " << sizeof(*pt) << endl;
cout <<"size of pd = " << sizeof(pd);
cout <<": size of *pd = " << sizeof(*pd) << endl;
return 0;
}