//
// use "const" instead of "var"
// because we're creating a static array
//
const
sArray : array [1..3] of string =
(
//
// now simply insert 3 strings
// according to the size of the
// array as defined above
//
'item #1',
'item #2',
'item #3'
);
How to declare and initialize static arrays
最新推荐文章于 2025-11-05 12:25:19 发布
本文详细介绍了在编程中如何使用const关键字替代var来创建静态数组,确保数组的值在声明后保持不变,适用于需要固定大小且不可修改的数据集合场景。
563

被折叠的 条评论
为什么被折叠?



