Do you really mean Managed C ++? Not C ++ / CLI?
Assuming you are actually using the C ++ / CLI (due to the error message you posted), there are two ways to do this:
array<String^>^ managedArray = gcnew array<String^>(10);
will create a managed array, i.e. same type as string [] in C #.
gcroot<String^>[] unmanagedArray;
will create an unmanaged C ++ array (I never tried to use this with arrays - it works well with stl containers, so it should work too).
Niki
source share