#include <iostream> using namespace std; int main() { int x; cin >> x; int* p = new int; // dynamically allocate an integer *p = x; // store input value cout << *p; // print stored value delete p; // free allocated memory return 0; }
Explanation & Logic Summary:
new int
*p
delete p
Firmware Relevance & Real-World Context:
new
delete
Test Cases
Test Results
Input
42
Expected Output