CHAPTER 7

image

Arrays

Give me a place to stand, and I will move the earth.

—Archimedes of Syracuse

In this chapter, we will look at C++ arrays, beginning with syntactic differences. C++/CLI offers two types of arrays:

  • Native arrays that are elements of classic C++
  • Managed arrays that are identical to C# arrays, though with different syntax

One of the first things you notice about managed arrays in C++ is that their declarations are completely different from those in C#, and that’s not a bad thing. When two languages are as similar as C# and C++, you can get a false sense of security and end up writing incorrect code that will come back to haunt ...

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.