C++ CLI vs. C# Keywords

Hier ein paar Samples für die Umsetzung C# zu C++ / CLI

Statische Klassen

C#: public static class XYZ {}

C++ / CLI : public ref class XYZ abstract sealed {}

 

ReadOnly Member

C#: public readonly string Text = “Hallo Welt”;

C++ / CLI: public: initonly System::String^ Text = “Hallo Welt”;

 

Static Const

C#: public static const string NAME = “Wert”;

C++ / CLI: public: literal System::String^ NAME = “Wert”;

 

Namespace

C#: namespace DE.Firma.Produkt { … }

C++ / CLI: namespace DE { namespace Firma { namespace Produkt {…}}}

 

Technorati-Markierungen: ,,,,,,,

Keine Kommentare: