Re: Technical reason why sizeof() is an operator and not a function?

In article <dqit7c$7ab$1@xxxxxxxxxxxxxxxxxxxx>, kers@xxxxxxxxxx says...
> Gerry Quinn wrote:
> > int* ptr = malloc( 100 * sizeof( int ) );
> Too vulnerable to changes in the type of `ptr`. Shiver.

That's irrelevant to the question of whether sizeof should take

That said, int pointers don't usually change. In C++ the equivalent

int* ptr = new int[ 100 ];

...and that doesn't seem to bother anyone.

- Gerry Quinn