#include <iostream>
int main()
{
int x = 20;
std::cout << " x = " << x << '\n';
int* p = &x;
*p = 10;
std::cout << " x = " << x << '\n';
std::cout << "*p = " << *p << '\n';
p = new int;
*p = -100;
std::cout << " x = " << x << '\n';
std::cout << "*p = " << *p << '\n';
*p = 25;
std::cout << " x = " << x << '\n';
std::cout << "*p = " << *p << '\n';
delete p; //NEVER forget to delete allocated memory
std::cin.ignore();
std::cin.get();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKQp7CiAgICBpbnQgeCA9IDIwOwogICAgc3RkOjpjb3V0IDw8ICIgeCA9ICIgPDwgeCA8PCAnXG4nOwoKICAgIGludCogcCA9ICZ4OwogICAgKnAgPSAxMDsKICAgIHN0ZDo6Y291dCA8PCAiIHggPSAiIDw8IHggPDwgJ1xuJzsKICAgIHN0ZDo6Y291dCA8PCAiKnAgPSAiIDw8ICpwIDw8ICdcbic7CgogICAgcCA9IG5ldyBpbnQ7CiAgICAqcCA9IC0xMDA7CiAgICBzdGQ6OmNvdXQgPDwgIiB4ID0gIiA8PCB4IDw8ICdcbic7CiAgICBzdGQ6OmNvdXQgPDwgIipwID0gIiA8PCAqcCA8PCAnXG4nOwoKICAgICpwID0gMjU7CiAgICBzdGQ6OmNvdXQgPDwgIiB4ID0gIiA8PCB4IDw8ICdcbic7CiAgICBzdGQ6OmNvdXQgPDwgIipwID0gIiA8PCAqcCA8PCAnXG4nOwogICAgZGVsZXRlIHA7IC8vTkVWRVIgZm9yZ2V0IHRvIGRlbGV0ZSBhbGxvY2F0ZWQgbWVtb3J5CiAgICBzdGQ6OmNpbi5pZ25vcmUoKTsKICAgIHN0ZDo6Y2luLmdldCgpOwp9Cg==