Created
April 5, 2012 15:33
-
-
Save darkhelmet/2311981 to your computer and use it in GitHub Desktop.
C sizeof operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To be pedantic, C sizeof doesn't operate on types either. The sizeof | |
operator applies to an expression or - this is the tricky bit - a type | |
cast. | |
thus | |
sizeof i | |
but also | |
sizeof(int) | |
but not | |
sizeof int | |
People think C sizeof is a function but it's an operator; the | |
expression sizeof(int) parses differently from the way most people | |
interpret it. | |
We're getting off topic. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment