Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
1
#include <iostream>
2
3
using namespace std;
4
5
int 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