CHAPTER 27Microsoft .Net, C# and C++11 Interoperability

27.1 Introduction and Objectives

In this chapter we introduce the C++/CLI (Common Language Infrastructure) language. It is a .NET programming language similar to C# and VB.NET in terms of efficiency and functionality but with the added advantage that it is possible to write applications containing a mixture of C++/CLI, C# and native C++ code.

Before we discuss the C++/CLI language we give an overview of the programming knowledge and skills that are needed in order to become comfortable with the language. In particular, it is especially important to understand the similarities and differences between native C++ and C++/CLI (and to a lesser extent between C# and C++/CLI). Ideally, a good working knowledge of C++ is a prerequisite in order to understand C++/CLI, including pointers, memory management, classes and templates. C++/CLI code can be mixed with native C++ code. It is important to distinguish between the two languages and this is achieved by having a good knowledge of each one. Furthermore, C++/CLI is relatively easy to learn for developers who already program in C#. Since C# and C++/CLI are both .NET languages they share a common syntax. Programs that have been written in C# are easily understood by developers who know C++/CLI and it is not too difficult for C# developers to fathom C++/CLI.

We summarise the goals and content in this chapter:

  • A global overview of the .NET language C++/CLI.
  • Memory management in .NET. ...

Get Financial Instrument Pricing Using C++, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.