clarkgrubb / hyperpolyglot

hyperpolyglot.org
Other
473 stars 94 forks source link

с: sizeof 1 + 1 #76

Open soulne4ny opened 7 years ago

soulne4ny commented 7 years ago

http://hyperpolyglot.org/c

sizeof 1 + 1 is not 4 on intel, but 5! sizeof is unary operator of higher priority than plus. That's why, it is not the same as golang's unsafe.Sizeof(1 + 1) which gives 8 on intel.

7fe commented 7 years ago

if this is true bump

soulne4ny commented 7 years ago

don't you see difference between sizeof (1 + 1) and sizeof 1 + 1?