#include <iostream> using namespace std; int main() { int x; //here the memory is allocated on the stack cin >> x; int *p = new int; // here the memory is allocated on heap *p = x; cout << *p; delete p; return 0; }
Test Cases
Test Results
Input
42
Expected Output