Windows编程常用的数据类型

1、使用 typedef 定义一个新的类型:CcTry_UINT16,即:占用2个字节的无符号整型类型!
2、用代码方式求 INT32、INT64、BOOL、BYTE、USHORT、LONGLONG 几个类型各占用几个字节?

#include <Windows.h>
#include <tchar.h>

typedef unsigned short CcTry_UINT16;
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, INT nShowCmd)
{
    int cb_CcTry_UINT16 = sizeof(CcTry_UINT16);    //2个字节
    int cb_INT32 = sizeof(INT32);    //4个字节
    int cb_INT64 = sizeof(INT64);    //8个字节
    int cb_BOOL = sizeof(BOOL);        //4个字节
    int cb_BYTE = sizeof(BYTE);        //1个字节
    int cb_USHORT = sizeof(USHORT);    //2个字节
    int cb_LONGLONG = sizeof(LONGLONG);    //8个字节

    return 0;
}

 

posted on 2021-01-17 22:43  SakuraQAQ  阅读(194)  评论(0)    收藏  举报

导航