我是一名C程序员,遇到过这个Delphi函数并且有几个问题。
procedure Init(const key; size: Integer; filler: Byte = $FF); overload
key
没有指定类型,在这种情况下它的类型是什么?$FF
”对变量filler
的含义是什么?答案 0 :(得分:6)
Key
参数是无类型参数。您可以在Rob Kennedy,What is an untyped parameter?
填充参数的$FF
值(0xFF十六进制,255十进制)是默认值,因此如果您没有为此参数赋值,填充符将采用默认值。
当您调用init过程时,您可以通过以下两种方式调用:
Init(Data,1,19);//in this case the key parameter is set to 19
或
Init(Data,1); //in this case the key parameter is set to $FF
答案 1 :(得分:0)
$ FF是变量填充的默认值,key是任何类型的常量值。它可能是整数或int64类型