/* testalloc1.cpp CIS 150 David Klick 6/28/05 Demonstration of allocating memory. */ #include using std::cout; int main(void) { // create a new double memory location and store the pointer double *p1 = new double; // displays whatever was in that location // some implementations may set the memory to 0 values cout << *p1 << '\n'; // must access new location through pointer *p1 = 1.23456; cout << *p1 << '\n'; // free the memory we allocated delete p1; return 0; }