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

VB Equivalent to C++ Arrays

Sized Array

C++ VB
int *myArrayOne = new int[2];
int myArrayTwo[3];
Dim myArrayOne(1) As Integer
Dim myArrayTwo(2) As Integer

Access Array Element

C++ VB
x = myArray[0]; x = myArray(0)

Jagged Array

C++ VB
int **myArray = new int*[2]; Dim myArray(1)() As Integer

Rectangular Array

C++ VB
int myArray[2][3]; Dim myArray()() As Integer = { New Integer(2){}, New Integer(2){} }

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

Additional resource: VB.NET and C++ Equivalents

Copyright © 2004 – 2021 Tangible Software Solutions, Inc.