The function returns the type of the object pointer.

   objectanyobject      // object pointer



[in]  Object pointer.

Return value

Returns a value from the ENUM_POINTER_TYPE enumeration.


An attempt to call an incorrect pointer results in the critical termination of a program. That's why it's necessary to call the CheckPointer function before using a pointer. A pointer can be incorrect in the following cases:

  • the pointer is equal to NULL;
  • the object has been deleted using the delete operator.

This function can be used for checking pointer validity. A non-zero value warranties that the pointer can be used for accessing.

To quickly validate the pointer, you can also use operator "!" (example) which checks it via an implicit call of the CheckPointer function.


//| Deletes list by deleting its elements                            |
void CMyList::Destroy()
//--- service pointer for working in the loop
   CItem* item;
//--- go through loop and try to delete dynamic pointers
         Print("Dynamic object ",item.Identifier()," to be deleted");
         delete (item);
      else Print("Non-dynamic object ",item.Identifier()," cannot be deleted");

See also

Object Pointers, Checking the Object Pointer, Object Delete Operator delete