CSC112 Spring 2016 Examples
1#include <iostream> 2 3using namespace std; 4 5int main() { 6 int *ptr; 7 8 ptr = new int; //create an integer 9 cout << ptr << endl; 10 cin >> *ptr; 11 cout << *ptr<< endl; 12 delete ptr; //destroy the integer 13 14 return 0; 15} 16 17