int是有符号的,而DWORD是无符号的
typedef unsigned long DWORD;
DWORD 32位 不是c++类型,它定义在windows.h中
int会随着机器位数的不同而发生变化,比如在16位机上为16为,在32位机上为32位,在64位机上为64位
建议在DWORD的地方尽量使用DWORD.
int 与 long的区别在这儿:[url=http://stackoverflow.com/questions/271076/what-is-the-difference-between-an-int-and-a-long-in-c/271132#271132]http://stackoverflow.com/questions/271076/what-is-the-difference-between-an-int-and-a-long-in-c/271132#271132[/url]
在win7 64, VS 2005中,上面输出12444
typedef unsigned long DWORD;
DWORD 32位 不是c++类型,它定义在windows.h中
int会随着机器位数的不同而发生变化,比如在16位机上为16为,在32位机上为32位,在64位机上为64位
建议在DWORD的地方尽量使用DWORD.
int 与 long的区别在这儿:[url=http://stackoverflow.com/questions/271076/what-is-the-difference-between-an-int-and-a-long-in-c/271132#271132]http://stackoverflow.com/questions/271076/what-is-the-difference-between-an-int-and-a-long-in-c/271132#271132[/url]
printf("%d", sizeof(char));
printf("%d", sizeof(short));
printf("%d", sizeof(int));
printf("%d", sizeof(DWORD));
printf("%d", sizeof(long));
在win7 64, VS 2005中,上面输出12444