C + + and C # type conversion __c#

Source: Internet
Author: User
C + + and C # type conversionsCategory: CSharp | Tags: C # system IntPtr char uint 2012-02-29 19:54 Reading (415) Comments (0)//c++:handle (void *)----c#:system . IntPtr
C++:byte (unsigned char)----c#:system.byte
C++:short (short)----c#:system.int16
C++:word (unsigned short)---c#:system.uint16
C++:int (INT)----c#:system.int16
C++:int (INT)----C#:system.int32
C++:uint (unsigned int)----c#:system.uint16
C++:uint (unsigned int)----C#:SYSTEM.UINT32
C++:long (LONG)----C#:system.int32
C++:ulong (unsigned long)--C#:system.uint32
C + +:D Word (unsigned long)-C#:system.uint32
C + +:D ecimal----c#:system.decimal
C++:bool (long)----C#:system.boolean
C++:char (char)----C#:system.char//c++:lpstr (char *)----c#:system.string
C++:LPWSTR (wchar_t *)----c#:system.string
C++:LPCSTR (const char *)---c#:system.string
C++:LPCWSTR (const wchar_t *)---
C#:system.string
C + +:P Cahr (char *)----c#:system.string//c++:bstr----c#:system.string//c++:float (fl OAT)----C#:system.single
C + +:D ouble (DOUBLE)----c#:system.double
C++:variant----C#:system.object
C + +:P byte (byte *)----c#:system.byte[]
C++:BSTR----C#:stringbuilder//c++:lpctstr----c#:stringbuilder//c++:lpctstr---- C#:string
C++:LPTSTR----C#:[marshalas (UNMANAGEDTYPE.LPTSTR)] string//c++:lptstr----c#:stringbuilder C++:LPCWSTR----C#:INTPTR
C++:bool----C#:bool
C++:hmodule----c#:intptr//c++:hinstance----c#:intptr//c++: Structural body----C #:p Ublic           struct structure body {}; C + +: Structure Body * * Variable name----c#:out variable name
In C # Advance declaration of a struct-instantiated variable name//c++: struct & variable name----C#:REF Structural body variable name
C++:word----C#:ushort
C + +:D Word----c#:uint
C + +:D Word----c#:int
C++:uchar----C#:int
C++:uchar----C#:byte
c++:uchar*----c#:string//c++:uchar*----c#:intptr
C++:guid----C#:guid
C++:handle----C#:INTPTR
C++:hwnd----C#:INTPTR
C + +:D Word----c#:int
C++:colorref----c#:uint//c++:unsigned char----c#:byte//c++:unsigned char *---- C#:ref byte//c++:unsigned char *----c#:[marshalas (UnmanagedType.LPArray)] byte[]
c++:unsigned char *----c#:[marshalas (UnmanagedType.LPArray)] Intptr
c++:unsigned Char &----c#:ref byte//c++:unsigned char variable name----c#:byte variable name
c++:unsigned short variable name----c#:ushort variable name
c++:unsigned int variable name----c#:uint variable name
c++:unsigned Long variable name----c#:ulong variable name
C++:char variable name----c#:byte variable name//c++ a character in a byte, a character in C # with two bytes
Said
C++:char array name [array size]----C#:marshalas (UnmanagedType.ByValTStr, SizeConst
= array size)]//c++:char *----c#:string//c++:char *----C#:stringbuilder C++:char * Variable name----C#:REF string variable name
Related Article

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.