CHAPTER 4

image

C# to C++/CLI

This is like déjà vu all over again.

—Yogi Berra

In this chapter, I show you how to convert a basic C# application to C++/CLI. I cover more advanced conversion methods in greater detail in later chapters.

Converting a C# Application

Let me start by taking apart the elements of the C# shuffling program from Chapter 2 and detailing the necessary changes, one at a time. Rather than pedantically plodding through the code line by line, I’ll draw representative samples from the code and present the finished product.

The code from Chapter 2 follows, with line numbers inserted, just so you don’t have to flip back and forth: ...

Get C++ 2013 for C# Developers,Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.