sizeof
本文转载百度百科。 编辑本段 用法 var a : array[1..10000] of longint; Begin Writeln(SizeOf(a)); End. 输出:40000 如果定义Integer,则输出:20000 c语言 中判断数据类型长度符 用法 sizeof(类型说明符, 数组 名或表达式); 或 sizeof 变量名 1. 定义: sizeof是C/C++中的一个操作符(operator)是也,简单的说其作用就是返回一个对象或者类型所占的内存字节数。 MSDN上的解释为: The sizeof keyword gives the amount of storage, in bytes, associated with a variable or a type (including aggregate types). This keyword returns a value of type size_t. 其返回值类型为size_t,在头文件 stddef.h 中定义。这是一个依赖于编译系统的值,一般定义为 typedef unsigned int size_t; 世上 编译器 林林总总,但作为一个规范,它们都会保证char、signed char和unsigned