// use_new.cpp _ using the new operator
#include <iostream>
using namespace std;
int main()
{
    int * pi = new int;         // allocate space for an int
    *pi = 1001;                 // store a value there

    cout << "int ";
    cout << "value = " << *pi << ": location = " << pi << "\n";

    double * pd = new double;   // allocate space for a double
    *pd = 10000001.0;           // store a double there

    cout << "double ";
    cout << "value = " << *pd << ": location = " << pd << "\n";
    cout << "size of pi = " << sizeof pi;
    cout << ": size of *pi = " << sizeof *pi << "\n";
    cout << "size of pd = " << sizeof pd;
    cout << ": size of *pd = " << sizeof *pd << "\n";
    return 0;
}

