15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Defining Types ❘ OC161<br />

// <strong>C#</strong><br />

MyStruct ms;<br />

// C++/CLI<br />

MyStruct ms1;<br />

MyStruct* pms2 = new MyStruct();<br />

MyStruct^ hms3 = gcnew MyStruct();<br />

' Visual Basic<br />

Dim ms as MyStruct<br />

Predefined value types for the different languages are listed in the following table. In C++/CLI, the char type<br />

has a size of just 1 byte for an ASCII character. In <strong>C#</strong>, char has a size of 2 bytes for Unicode characters;<br />

that’s a wchar_t in C++/CLI. The ANSI st<strong>and</strong>ard for C++ just defines short

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!