Grown Up Pointers
Shared_pointers #include<iostream> int main(){ int *b=new int(12); //initialize the pointer int *c; c=b; //make pointer c points to same pointer delete b; //delete the pointers std::cout<<*c; } Above program will produce an error on running. Why? because the object to which c was pointing got deleted will c is still pointing to it. In … More Grown Up Pointers