Reputation: 1103
I came across this code but I couldn't understand it:
void *operator new(unsigned int some_variable)
-> Here new
is a function but I can't understand what void *operator
is doing and here is the complete code:
int buf[3];
void *operator new(unsigned int uiSize)
{
return (void *)buf;
}
Upvotes: 0
Views: 101
Reputation: 472
This is Operator Overloading that defines an implementation for the operator new
and returns Void Pointer
For more information about overloading in C++, you can check this link.
Upvotes: 1