I want to check with you guys .
here is an example.
I have a class like this
Foo *objPtr = new Foo;
for ( int i =0; i<5 ;i++ )
objPtr[i]->data = i;
if ( i == 3 )
objPtr[i] = NULL; //Can I do somthing like this
in this program can I do objPtr[i] = NULL and then call the delete. does this make sense? Please explain to me.
I need to make the pointer null in my original program it it meets some condition. and finally once I an done with all I will call delete. Please someone explain to me.