Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用名为:在delphi中的内置python函数struct.unpack,就像python一样。这是一个例子:
struct.unpack
x = struct.unpack(">H",data[offset:offset+2])[0]
>H是一个大端无符号的两字节值。
>H
在德尔福你会这样做:
var x: Word; data: TBytes; .... x := ntohs(PWord(@data[offset])^);
让我们更详细地看一下:
data
data[offset]
ntohs
Word
为了打电话ntohs,您需要使用该Winsock设备。
Winsock