Free Pascal 中文字数组的语法是什么?

发布于 2024-12-10 04:49:12 字数 115 浏览 1 评论 0原文

我想将一个 50 多个硬编码字节列表存储在字节数组中,但我找不到 Free Pascal 的硬编码数组语法。

集合使用[elem, elem, elem],那么数组使用什么?

There's a 50-odd hard-coded byte list I'd like to store in a byte array, but I can't find Free Pascal's syntax for hard-coded arrays.

Sets use [elem, elem, elem], so what do arrays use?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

静谧 2024-12-17 04:49:12

试试这个

Const
  MyArray : Array[0..3] of byte= (0,1,2,3);   

更新

你必须把这个翻译

static int xlat[] = {
0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f,
0x41, 0x2c, 0x2e, 0x69, 0x79, 0x65, 0x77, 0x72,
0x6b, 0x6c, 0x64, 0x4a, 0x4b, 0x44, 0x48, 0x53,
0x55, 0x42, 0x73, 0x67, 0x76, 0x63, 0x61, 0x36,
0x39, 0x38, 0x33, 0x34, 0x6e, 0x63, 0x78, 0x76,
0x39, 0x38, 0x37, 0x33, 0x32, 0x35, 0x34, 0x6b,
0x3b, 0x66, 0x67, 0x38, 0x37
};

static int XLAT_SIZE = 53;

成这个

const
 XLAT_SIZE = 53;
 xlat : Array[0..XLAT_SIZE-1] of Integer = (
 $64, $73, $66, $64, $3b, $6b, $66, $6f,
 $41, $2c, $2e, $69, $79, $65, $77, $72,
 $6b, $6c, $64, $4a, $4b, $44, $48, $53,
 $55, $42, $73, $67, $76, $63, $61, $36,
 $39, $38, $33, $34, $6e, $63, $78, $76,
 $39, $38, $37, $33, $32, $35, $34, $6b,
 $3b, $66, $67, $38, $37
);

try this

Const
  MyArray : Array[0..3] of byte= (0,1,2,3);   

UPDATE

you must translate this

static int xlat[] = {
0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f,
0x41, 0x2c, 0x2e, 0x69, 0x79, 0x65, 0x77, 0x72,
0x6b, 0x6c, 0x64, 0x4a, 0x4b, 0x44, 0x48, 0x53,
0x55, 0x42, 0x73, 0x67, 0x76, 0x63, 0x61, 0x36,
0x39, 0x38, 0x33, 0x34, 0x6e, 0x63, 0x78, 0x76,
0x39, 0x38, 0x37, 0x33, 0x32, 0x35, 0x34, 0x6b,
0x3b, 0x66, 0x67, 0x38, 0x37
};

static int XLAT_SIZE = 53;

to this

const
 XLAT_SIZE = 53;
 xlat : Array[0..XLAT_SIZE-1] of Integer = (
 $64, $73, $66, $64, $3b, $6b, $66, $6f,
 $41, $2c, $2e, $69, $79, $65, $77, $72,
 $6b, $6c, $64, $4a, $4b, $44, $48, $53,
 $55, $42, $73, $67, $76, $63, $61, $36,
 $39, $38, $33, $34, $6e, $63, $78, $76,
 $39, $38, $37, $33, $32, $35, $34, $6b,
 $3b, $66, $67, $38, $37
);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文