typedef type-declaration synonym;The typedef keyword defines a synonym for the specified type-declaration. The identifier in the type-declaration becomes another name for the type, instead of naming an instance of the type. You cannot use the typedef specifier inside a function definition.A typedef declaration introduces a name that, within its scope, becomes a synonym for the type given by the decl-specifiers portion of the declaration. In contrast to the class, struct, union, and enum declarations, typedef declarations do not introduce new types — they introduce new names for existing types.Example// Example of the typedef keyword typedef unsigned long ulong;ulong ul; // Equivalent to "unsigned long ul;"typedef struct mystructtag { int i; float f; char c; } mystruct;mystruct ms; // Equivalent to "struct mystructtag ms;"typedef int (*funcptr)(); // funcptr is synonym for "pointer // to function returning int"funcptr table[10]; // Equivalent to "int (*table[10])();"
PVOID == void* PVOID是一个什么类型
代表一個無類型指針,就好像java中的object類型一樣
这还不明白,就是用PVOID作为void*的别名!
ruihuahan(飞不起来的笨鸟) 就的对
老兄,也跑到这里来了。呵呵。那玩意像: type PRect = ^TRect;PVOID相当于Pointer(pascal),就是无类型的指针。是反过来看的。
typedef int (*funcptr)(); 转成pascal type TFunc = function: Integer; // or stdcallfar是为以前系统兼容的,现在的win32没什么用了,如果你写16位的话,可能有点用,好像是跨段址指针的访问吧,我也不清楚。反正指针不懂时,我一般都是看定义就明白了,呵呵,今天不懂,明天再看,天天看着,有一天:哦,原来如此
typedef void *HANDLE;
关注。
就是用PVOID来代表void*。
PVOID == void*
typedef unsigned long ulong;ulong ul; // Equivalent to "unsigned long ul;"typedef struct mystructtag
{
int i;
float f;
char c;
} mystruct;mystruct ms; // Equivalent to "struct mystructtag ms;"typedef int (*funcptr)(); // funcptr is synonym for "pointer
// to function returning int"funcptr table[10]; // Equivalent to "int (*table[10])();"
PVOID是一个什么类型
type
PRect = ^TRect;PVOID相当于Pointer(pascal),就是无类型的指针。是反过来看的。
转成pascal
type
TFunc = function: Integer; // or stdcallfar是为以前系统兼容的,现在的win32没什么用了,如果你写16位的话,可能有点用,好像是跨段址指针的访问吧,我也不清楚。反正指针不懂时,我一般都是看定义就明白了,呵呵,今天不懂,明天再看,天天看着,有一天:哦,原来如此
.h里面有好多自定义的类型,我delphi翻译了几天了
谢谢大家了