求助熟悉delphi的兄弟, Pascal 和C++的对应写法!
如下 pascal 语句
type
PPacket = ^TPacket;
TPacket = packed record
case Integer of
0: (b0, b1, b2, b3: Byte);
1: (i: Integer);
2: (a: array[0..3] of Byte);
3: (c: array[0..3] of Char);
end;
对应成如下c++,请问是否对?另外上面 Pascal 的case Integer of 是否对应C++的构造函数?
struct TPacket
{
Byte b0, b1, b2, b3;
int i;
Byte a[3];
char c[3];
};