Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 什么';在自由Pascal中,文字数组的语法是什么?_Arrays_Literals_Freepascal - Fatal编程技术网

Arrays 什么';在自由Pascal中,文字数组的语法是什么?

Arrays 什么';在自由Pascal中,文字数组的语法是什么?,arrays,literals,freepascal,Arrays,Literals,Freepascal,我想将50多个硬编码字节列表存储在字节数组中,但我找不到用于硬编码数组的免费Pascal语法 集合使用[elem,elem,elem],那么数组使用什么呢?试试这个 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, 0x

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

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

试试这个

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
);

为什么不能使用字符串呢?变量是一个静态密钥,由简单加密方案中使用的字节组成。一个字符串就足够了,但1)密钥中的每个字节都必须转义,2)使用字节数组将强化密钥实际上是byre数组的想法。确切地说,密钥是
xlat
in。语法是否相同?复制语法时,发现
致命:语法错误,“,”预期但“)”
。如何连接两字节数组?2.7.1还支持Delphi compat dynarray.create语法。