Dynamic array parameter

Top  Previous  Next

What is translated > Types > Arrays > Array parameters > Dynamic array parameter

 

A Delphi function accepts a dynamic array as parameter, if it is defined explicitly:

 

type

strarray = Array of String;

procedure Check(aSources : strarray);

->

 

C++Builder

typedef DynamicArray<System::String> strarray;

void __fastcall Check(strarray& aSources);

 

Other   

typedef std::vector<System::String> strarray;

void Check(strarray& aSources);  

 

 

In this case Delphi2Cpp II translates such a parameter as a reference to a dynamic array. The parameter is translated like an open array however, if the type isn't defined explicitly. In this case the C++ compiler will fail, if it is tried to pass a dynamic array to this function.

 

 



This page belongs to the DelphiXE2Cpp11 Documentation

DelphiXE2Cpp11 home  Content