C++ examples for Operator:delete
Using new and delete to use heap memory
#include <iostream> using namespace std; int main(int argc, char* argv[]) { int* pInt{ new int }; *pInt = 100;/*from www . ja v a 2s . com*/ cout << hex << "The address at pInt is " << pInt << endl; cout << dec << "The value at pInt is " << *pInt << endl; delete pInt; pInt = nullptr; return 0; }