// ptr3.cpp By: Aiman Hanna - ©1993-2006 Aiman Hanna // This program illustrates the concept of memory allocation, or more precisely // dynamic memory allocation. // // Key points: 1) Memory allocation .. the "new" operator. #include int main() { int *p = new int, *q = new int; *q = 5; p = q; cout << *p << "\n"; return 0; } // The following is the result of compilation // Compilation successful // The following is the result of running the program /* 5 */