c 中的資料型別如何與API中的型別定義對應!

2021-09-05 13:46:30 字數 1456 閱讀 1025

wtypes.h 中的非託管型別    非託管c 語言型別    託管類名       說明

handle                     void*               system.intptr  32 位

byte                       unsigned char       system.byte    8 位

short                      short               system.int16   16 位

word                       unsigned short      system.uint16  16 位

int                        int                 system.int32   32 位

uint                       unsigned int        system.uint32  32 位

long                       long                system.int32   32 位

bool                       long                system.int32   32 位

dword                      unsigned long       system.uint32  32 位

ulong                      unsigned long       system.uint32  32 位

char                       char                system.char    用 ansi 修飾。

lpstr                      char*               system.string 或 system.stringbuilder 用 ansi 修飾。

lpcstr                     const char*         system.string 或 system.stringbuilder 用 ansi 修飾。

lpwstr                     wchar_t*             system.string 或 system.stringbuilder 用 unicode 修飾。

lpcwstr                     const wchar_t*      system.string 或 system.stringbuilder 用 unicode 修飾。

float                      float                system.single 32 位

double                     double                 system.double 64 位

c 中的資料型別與轉換

資料型別轉換using system using system.collections.generic using system.linq using system.text using system.threading.tasks namespace csharp 轉換的整數值為 tr,num 如...

C 中的資料型別

一 值型別 三種 1 簡單型別 types a 整數型別 八種 sbyte 有符號8位整數 128 127 byte 無符號8位整數 0 255 short 有符號16位整數 32768 32767 ushort 無符號16位整數 0 65535 int 有符號32位整數 2147483648 21...

c 中的資料型別

c 中的資料型別大致分為兩類 變數 常量,下面具體介紹一下 一.變數 變數分為一下幾種 布林變數 bool 佔乙個位,可以賦值為true 1 false 0 個人理解就是巨集定義,寫在標頭檔案中 字元型變數 char 佔乙個位元組 雙位元組型變數 一般佔2個位元組 用途以後再說 整形變數 int l...