is sizeof a key word?
sizeof is the key word , which is beyond doubt. You cannot define sizeof as any identifier. See the instructions in the C language standard documentation:
Does sizeof have an operator (operator)?
In C,sizeof is an operator (operator)and is the only operator that appears as a word, which is used to calculate how many bytes are required to hold a certain amount, and its associativity is right-to-left. See the instructions in the C language standard documentation:
is sizeof a function?
sizeof is not a function . The main reason for this is that sometimes the external performance of sizeof is somewhat analogous to a function, such as: i = sizeof (int), and it is easy to mistake the fact that sizeof is a function. But if sizeof is a function, then sizeof I; (assuming i is an int variable) This formula must not be true, because the function's parameters cannot be enclosed in parentheses. In fact, this sizeof I; it works, which means that sizeof is definitely not a function.
sizeof Usage
sizeof is a key-word halo that plays the role of an operator. It is used primarily to calculate the number of bytes required for a certain amount in the current system:
Can the parentheses behind the sizeof be removed? If it is a specific amount, either constant or variable, you can write the sizeof amount directly, but if you are working on a type, you must add parentheses:
Operation Result:
Notice the abnormal situation, this shows: sizeof face direct volume such as ' A ', 65, and so on, it will default to the int type calculation, if you need to calculate the direct constant size of char or short, you need to cast.
Summary
When it comes to grammatical doubt, the standard document that is published is the most persuasive of the explanatory documents.
sizeof is both a keyword and an operator (operator), but not a function!