DeletePointer

DeletePointer - *p = z cout<<"p"<<...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#include <iostream> using namespace std ; int main() { int x = 1, y = 2, z = 3 ; int *p = &x ; cout << "p: " << p << ", *p: " << *p << endl ; p = new int ; if (p == NULL) { cout << "Memory allocation failed." << endl ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } *p = z ; cout << "p: " << p << ", *p: " << *p << endl ; delete p ; cout << "p: " << p << ", *p: " << *p << endl ; }...
View Full Document

Ask a homework question - tutors are online