This documentation is archived and is not being maintained.

Compiler Error C2541

'delete' : delete : cannot delete objects that are not pointers

The delete operator was used on an object that is not a pointer.

The following sample generates C2541:

// C2541.cpp
int main() {
   int i;
   delete i;   // C2541 i not a pointer

   // OK
   int *ip = new int;
   delete ip;