/* Variables go in one of three places: • stack: Local variables • heap: Space allocated via new • static memory: global variables, static variables */ #include #include using namespace std; int g; int main() { static double d; long *p = new long[10]; vector v = {11,22,33}; cout << "address of g: " << &g << "\n" "address of d: " << &d << "\n" "address of p: " << &p << "\n" "address of v: " << &v << "\n" "address of p[0]: " << &p[0] << "\n" "address of v[0]: " << &v[0] << "\n"; delete[] p; // only cleanup necessary return 0; }