Nusrat Nuriyev
asked on
29. Can we define new operation?
Can we define new operation?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you, will review that a bit later
ASKER
Yes, I have checked obj=NULL does not affect the original pointer.
When I tried to change to void** , it started to blame:
When I tried to change to void** , it started to blame:
new_del.cpp:13:30: error: ‘operator delete’ takes type ‘void*’ as first parameter
void operator delete(void**);
Yes, we may overload the new and delete, but are those operator's prototypes are "carved in stone"?
ASKER
int buffer[256]; // providing 'sizeof(MyClass)' only would work with gcc/g++
I don't get this comment. PLease, explain.
ASKER
Open in new window
>>> There is also a so-called 'placement new' that allows you to create an object on a certain memory area that you can choose.
How we can create an object on a certain memory area?