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;
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for