Overloading new operator

Hi,
To overload new operator i came across code like this

void*operator new(size_t s,int i)
{ int*q=(jnt *)malloc(s);
*q=i;
return q;
}

when invoking in main they di like this
int*p=new(25)int;
cout<<*p;

If i have to overloaded + operator.....i invoke it like
a+b then it will be taken as a.operator+(b) if i define it as member function and as operator+(a,b) if defined + operator as a friend function.
but here i think accrding to the definition new operator is defined above it should be invoked like this according to my understanding.

a new b;(like first_operand operator second_operand)

a mentions size to be allocated and b intialises.....but i have no ideas how to convey which data types to be allocated memroy(like chars or ints) in this way.I may b totally wrong.

but how the above statement invoking new works??????????????????? its totally out of my understanding ...i am new to c++ ..please help.
Topic archived. No new replies allowed.