Dynamic arrays

Top  Previous  Next

What is translated > Dynamic arrays

 

Dynamic arrays are simulated in the CBuilder C++ by the class DynamicArray:

 

template <class T> class DELPHIRETURN DynamicArray;

 

If the output is generated for other compilers std::vector is used instead of a DynamicArray.

 

MyFlexibleArray: array of Real;

->

DynamicArray < double > MyFlexibleArray;  // CBuilder

std::vector < double > MyFlexibleArray;   // other compiler 

 

 

This DynamicArray class has the properties Low, High and Length. By the Length property, the size of the array can be changed. Dynamic arrays are accepted as parameters only, if the type of the array is defined explicitly and if the function expects this type.

 

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content