// new_01.cpp -- using the new operator
#include <iostream>
int main()
{
    using namespace std;

    int * p_int = new int;         // allocate space for an int
    *p_int = 56;                 // store a value there

    // pritning out value and location of int
    cout << "int ";
    cout << "value = " << *p_int << ": location = " << p_int << endl;

    double * p_doub = new double;   // allocate space for a double
    *p_doub = 46534.4363;           // store a double there

    // printing out value and location of double
    cout << "double ";
    cout << "value = " << *p_doub << ": location = " << p_doub << endl;
    
    // printing out sizes
    cout << "size of p_int = " << sizeof(p_int);
    cout << ": size of *p_int = " << sizeof(*p_int) << endl;
    cout << "size of p_doub = " << sizeof p_doub;
    cout << ": size of *p_doub = " << sizeof(*p_doub) << endl;
}
