Appendix B. Appendix – C++/CLI summary tables

Table of Contents
B.1. C++/CLI reserved words
B.2. The types of classes and structures in C++/CLI
B.3. Operators for pointers and references in C++/CLI
B.4. The .NET (CTS) and the C++/CLI primitive types

B.1. C++/CLI reserved words

abstract

for each

interior_ptr

ref class/struct

array

gcnew

literal

safe_cast

delegate

generic

nullptr

sealed

enum class/struct

in

override

value class/struct

event

initonly

pin_ptr

where

finally

interface class/struct

property

 

B.2. The types of classes and structures in C++/CLI

Keyword

Domain

Default access

Equivalent

Used by

class

native

private

class in C++

value, native pointer or reference

struct

native

public

struct in C++

value, native pointer or reference

ref class

managed

private

class in C#

managed reference

ref struct

managed

public

class in C#

managed reference

value class

managed

private

struct in C#

value

value struct

managed

public

struct in C#

value

B.3. Operators for pointers and references in C++/CLI

Operation

Native Code

Managed Code

Pointer definition Pointer dereference

*

^

Reference definition Address-of

&

%

Member access

->

->

Allocation

new

gcnew

Deallocation

delete

delete (calls Dispose)

B.4. The .NET (CTS) and the C++/CLI primitive types

.NET type

C++/CLI

Char

wchar_t

Boolean

bool

Byte

unsigned char

SByte

char

Int16

short

UInt16

unsigned short

Int32

int, long

UInt32

unsigned int, unsigned long

Int64

long long

UInt64

unsigned long long

Double

double

Single

float