C # and C + + data types corresponding tables

Source: Internet
Author: User

C # Calling DLL file time parameter corresponding table

unmanaged types in Wtypes.h

unmanaged C language type

managed class name

Description

HANDLE

void*

System.IntPtr

32-bit

BYTE

unsigned char

System.Byte

8-bit

Short

Short

System.Int16

16-bit

WORD

unsigned short

System.UInt16

16-bit

INT

int

System.Int32

32-bit

UINT

unsigned int

System.UInt32

32-bit

LONG

Long

System.Int32

32-bit

BOOL

Long

System.Int32

32-bit

DWORD

unsigned long

System.UInt32

32-bit

ULONG

unsigned long

System.UInt32

32-bit

CHAR

Char

System.Char

Decorated with ANSI.

LPSTR

char*

System.String or System.stringbuilder

Decorated with ANSI.

LPCSTR

Const char*

System.String or System.stringbuilder

Decorated with ANSI.

LPWSTR

wchar_t*

System.String or System.stringbuilder

Decorated with Unicode.

LPCWSTR

Const wchar_t*

System.String or System.stringbuilder

Decorated with Unicode.

FLOAT

Float

System.Single

32-bit

DOUBLE

Double

System.Double

64-bit

category

class name

Description

Visual Basic data Types

C # data type

Managed Extensions for C + + data types

JScript Data Type

Integer

Byte

A 8-bit unsigned integer.

Byte

byte

Char

Byte

SByte

A 8-bit signed integer.

is not CLS-compliant.

SByte

No built-in type.

sbyte

signed Char

SByte

Int16

A 16-bit signed integer.

Short

Short

Short

Short

Int32

A 32-bit signed integer.

Integer

int

int

Or

Long

int

Int64

A 64-bit signed integer.

Long

Long

__int64

Long

UInt16

A 16-bit unsigned integer.

is not CLS-compliant.

UInt16

No built-in type.

ushort

unsigned short

UInt16

UInt32

A 32-bit unsigned integer.

is not CLS-compliant.

UInt32

No built-in type.

UINT

unsigned int

Or

unsigned long

UInt32

UInt64

A 64-bit unsigned integer.

is not CLS-compliant.

UInt64

No built-in type.

ULONG

unsigned __int64

UInt64

Floating point

Single

Single-precision (32-bit) floating-point number.

Single

float

float

float

Double

Double-precision (64-bit) floating-point number.

Double

Double

Double

Double

Logic

Boolean

Boolean value (True or false).

Boolean

BOOL

BOOL

BOOL

Other

Char

Unicode (16-bit) character.

Char

Char

wchar_t

Char

Decimal

96-bit decimal value.

Decimal

decimal

Decimal

Decimal

IntPtr

The size depends on the signed integer of the underlying platform (32-bit value on the 32-bit platform, 64-bit platform 64-bit).

IntPtr

No built-in type.

IntPtr

No built-in type.

IntPtr

No built-in type.

IntPtr

UIntPtr

The size depends on the unsigned integer of the underlying platform (32-bit on the 32-bit platform and 64-bit platform for 64-bit values).

is not CLS-compliant.

UIntPtr

No built-in type.

UIntPtr

No built-in type.

UIntPtr

No built-in type.

UIntPtr

Class object

Object

The root of the object hierarchy.

Object

Object

object*

Object

String

Invariant fixed-length string of Unicode characters.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.