#include <stdio.h> int main() { short a = 10; int b = 100; long c=100; int short_length = sizeof a; int int_length = sizeof(b); int long_length = sizeof(long); int char_length = sizeof(char); printf("short=%d, int=%d, long=%d, char=%d\n",…
C语言关键字 sizeof 是一个操作符,返回对象或类型所占内存字节数,类型为size_t(定义在<stddef.h>),有2种用法: sizeof unary-expression sizeof (type-name) sizeof不能应用的场合: an expression that has function type or an incomplete type the parenthesized name of such a type an expression that designa…