• Saves Valuable Time
  • Trusted Accuracy since 2004
  • 15-Day Money-Back Guarantee

C# Equivalent to C++ Pointers

Even though C# allows pointers in 'unsafe' mode, this is not a good practice for converting C++ code to C#. Below is the conversion to typical C#.

C++ C#
//raw pointer:
Foo *f1 = new Foo();

//'smart' pointer:
std::shared_ptr<Foo> f2 = std::make_shared<Foo>();
Foo f1 = new Foo();

Foo f2 = new Foo();

Use C++ to C# Converter to convert from C++ to C#.     

Additional resource: C++ and C# Equivalents

Copyright © 2004 – 2021 Tangible Software Solutions, Inc.