#include <iostream>usingnamespace std;
int main()
{
// cout << 0x25 << "\n"; // prints in decimal by default// cout << hex << 175 << "\n"; // can specify to print in hex// cout << dec << 0xCAFE << "\n"; // switch back to base 10// cout << "An int is " << sizeof(int) << " bytes.\n";// cout << "A double is " << sizeof(double) << " bytes.\n";// cout << "A char is " << sizeof(char) << " bytes.\n";// cout << "A long is " << sizeof(long) << " bytes.\n";// cout << "A float is " << sizeof(float) << " bytes.\n";int x = 13;
double d = 3.1415;
int y = 20;
cout << "x is at " << &x << "\n";
cout << "d is at " << &d << "\n";
cout << "y is at " << &y << "\n";
int* p = NULL;
cout << "p is " << p << "\n";
p = &x;
cout << "p is now " << p << "\n";
*p = 99; // changes x
cout << "x is now the value " << x << "\n";
p = &y;
cout << "p is now " << p << "\n";
*p = 44; // changes y
cout << "y is now the value " << y << "\n";
// Pointers and arraysint a[3];
cout << "a is " << a << "\n";
cout << "a[0] is at " << &(a[0]) << "\n";
cout << "a[1] is at " << &(a[1]) << "\n";
cout << "a[2] is at " << &(a[2]) << "\n";
cout << "a + 2 is " << a+2 << "\n";
double* q = &d;
cout << "q + 5 is " << q+5 << "\n";
return0;
}