new operator

Hi,

Please clear the 2 questions,

2 Questions,

1) Why the new as a operator? Is there any special reason why it can't be a function like malloc?

2) How are we considering sizeof(),new are as a opearartors? I know + - * / -> , . etc.. are operators, which criteria satisfied by sizeof() since we are calling sizeof with function call operators "()".

Thanks,
Naga:cool:

are you kidding?

sizeof - what ever you wanna mesaure the size of, pretty much any variable name

Hi,

Thanks for your reply, I know the usage of sizeof operator, please once again read my 2 questions and request you to answer it.

Thanks,
Naga:cool:

because that was the fad when it was designed, to mix system-dependent, OS-dependent, and language-dependent things together into one glorious operator-overloadable mess. It cannot be a library function because such things don't have access to constructors and destructors, it has to be a language feature.

Hi,

Woww Thanks Mr. Corona688, i got the answer from your reply.

Thanks,
Naga:cool: