I use this malloc style all the time
int *rc = 0; rc = malloc(sizeof(*rc));
However, it doesn\'t seg fault even though when I call
The sizeof operator doesn't actually evaluate its operand, it only looks at its type. The type of *rc is int, so it's equivalent to sizeof (int). This all happens at compile time.
sizeof
*rc
int
sizeof (int)
(Also, this is not "inside of malloc".)