delphi與c之間的型別對應表.其中左邊是c型別,右邊是對應的delphi型別:
abc -> tabc
accel -> taccel
atom -> tatom
bitmap -> tbitmap
bitmapcoreheader -> tbitmapcoreheader
bitmapcoreinfo -> tbitmapcoreinfo
bitmapfileheader -> tbitmapfileheader
bitmapinfo -> tbitmapinfo
bitmapinfoheader -> tbitmapinfoheader
bool -> bool
cbt_createwnd -> tcbt_createwnd
cbtactivatestruct -> tcbtactivatestruct
char -> char
char* -> pchar
clientcreatestruct -> tclientcreatestruct
colorref -> tcolorref
compareitemstruct -> tcompareitemstruct
comstat -> tcomstat
createstruct -> tcreatestruct
ctlinfo -> tctlinfo
ctlstyle -> tctlstyle
ctltype -> tctltype
dcb -> tdcb
ddeaack -> tddeack
ddeadvise -> tddeadvise
ddedata -> tddedata
ddepoke -> tddepoke
debughookinfo -> tdebughookinfo
deleteitemstruct -> tdeleteitemstruct
devmode -> tdevmode
double -> double
drawitemstruct -> tdrawitemstruct
dword -> longint
enumlogfont -> tenumlogfont
eventmsg -> teventmsg
farproc -> tfarproc
fixed -> tfixed
float -> single
glyphmetrics -> tglyphmetrics
handle -> thandle
handletable -> thandletable
hardwarehookstruct -> thardwarehookstruct
helpwininfo -> thelpwininfo
int -> integer
kerningpair -> tkerningpair
logbrush -> tlogbrush
logfont -> tlogfont
logpalette -> tlogpalette
logpen -> tlogpen
long -> longint
long double -> extended
long int -> longint
lpstr -> pchar
lpwstr -> pwidechar
mat2 -> tmat2
mdicreatestruct -> ***icreatestruct
measureitemstruct -> tmeasureitemstruct
menuitemtemplate -> tmenuitemtemplate
menuitemtemplateheader -> tmenuitemtemplateheader
metafilepict -> tmetafilepict
metaheader -> tmetaheader
metarecord -> tmetarecord
minmaxinfo -> tminmaxinfo
mousehookstruct -> tmousehookstruct
msg -> tmsg
multikeyhelp -> tmultikeyhelp
nccalcsize_params -> tnccalcsize_params
newtextmetric -> tnewtextmetric
ofstruct -> tofstruct
outlinetextmetric -> toutlinetextmetric
paintstruct -> tpaintstruct
paletteentry -> tpaletteentry
panose -> tpanose
pattern -> tpattern
pointfx -> tpointfx
pstr -> pchar
pwstr -> pwidechar
rasterizer_status -> trasterizer_status
rgbquad -> trgbquad
rgbtriple -> trgbtriple
seginfo -> tseginfo
short -> smallint
short int -> smallint
size -> tsize
textmetric -> ttextmetric
tpoint -> tpoint
trect -> trect
ttpolycurve -> tttpolycurve
ttpolygonheader -> tpolygonheader
uint -> word
unsigned -> word
unsigned char -> byte
unsigned int -> word
unsigned long -> longint(dword)
unsigned long int -> longint
unsigned short -> word
unsigned short int -> word
void* -> pointer
windowplacement -> twindowplacement
windowpos -> twindowpos
wndclass -> twndclass
word -> word
下面是一些 c 變數型別和 pascal 變數型別對照列表。
hwnd = type longword (cardinal)
hmenu = type longword
所有 handle 型別均是 type longword (cardinal) 或 thandle
(hicon, hbitmap, hfont, hbrush, hpen)
byte = byte
short = smallint;
int = integer
word = word
dword = longword; (cardinal)
long = integer
longlong = int64
uint = longword; (cardinal)
asci null terminated string = pansichar or pchar
lpstr = pansichar;
lpctstr = pansichar;
ulong = cardinal;
boolean = boolean
bool = longbool
lpvoid = pointer
psid = pointer
lcid = dword, longword (cardinal)
langid = word
理解 win32 api 幫助裡面的資料型別可能會有點困惑,因為裡面好幾個 c 型別被作為乙個 pascal 資料型別了,比如 dword、unit、hwnd、ulong 和 lcid 型別在 pascal 語言裡都是 cardinal 型別。更加令人困惑的是,很多 delphi 的示例**使用 pascal 型別 longword 代替 cardinal 型別,使用 longint 代替 integer 型別。如果你覺得 c 語言資料型別難以把握,你通常可以在**中使用 c 語言資料型別,因為這在 windows.pas 單元大部分都有這些型別的定義。比如, windows.pas 單元有如下定義:
type
dword = longword;
uint = longword;
lcid = dword;
ulong = cardinal;
c與Pascal型別對應
c語言的函式格式與delphi不同,它們是函式返回型別在前,函式宣告在後.對於沒有任何返回型別的函式則定義為void型別.例如 delphi中函式function myfunction intin integer bool 相應的c語言 就變成bool myfunction int intin 又例...
sqlserver 與 c 型別對應
sql server型別 c 型別 bitbool tinyint byte smallint short intint bigint long real float float double money decimal datetime datetime char string varchar s...
C與DELPHI指標型別
一 型別指標的定義。對於指向特定型別的指標,在c中是這樣定義的 int ptr char ptr 與之等價的object pascal是如何定義的呢?varptr integer ptr char 其實也就是符號的差別而已。二 無型別指標的定義。c中有void 型別,也就是可以指向任何型別資料的指標...