• Saves Valuable Time
  • Trusted Accuracy for 14 Years
  • 15-Day Money-Back Guarantee

C# Equivalent to C++ Arrays

Sized Array

C++ C#
int *myArrayOne = new int[2];
int myArrayTwo[3];
int[] myArrayOne = new int[2];
int[] myArrayTwo = new int[3];

Access Array Element

C++ C#
x = myArray[0]; x = myArray[0];   //no change

Jagged Array

C++ C#
int **myArray = new int*[2]; int[][] myArray = new int[2][];

Rectangular Array

C++ C#
int myArray[2][3]; int[,] myArray = new int[2, 3];

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

Additional resource: C++ and C# Equivalents

Copyright © 1997 – 2018 Tangible Software Solutions Inc.