天天看點

Delphi和C++資料類型對照表

delphi 字長 值域 c++

shortint 8位有符号整型 signed char

smallint 16位有符号整型 short

longint 32位有符号整型 int

byte 8位無符号整型 unsigned char

word 16位無符号整型 unsigned short

integer 32位有符号整型 int

cardinal 32位無符号整型 unsigned int

boolean 真假 bool

bytebool 真假 或 8位無符号整型 unsigned char

wordbool 真假 或 16位無符号整型 unsigned short

longbool 真假 或 32位無符号整型 bool (winapi)

ansichar 8位無符号字元 char

widechar 寬字編碼字元 wchar_t

char 8位無符号字元 char

ansistring delphi的字元串類 ansistring 類

string[n] 老式的delphi字元串, n = 1..255位元組 smallstring 模闆類

shortstring 老式的delphi字元串, 255位元組 smallstring 255

string delphi的ansistring類 ansistring

single 32位浮點數 float

double 64位浮點數 double

extended 80位浮點數 long double

real 32位浮點數 double

pointer 32無類型指針 void *

pchar 32位字元型指針 unsigned char *

pansichar 32位ansi型字元指針 unsigned char *

comp 64位浮點數 comp 類

olevariant ole可變類型值 olevariant 類