Dynamic array parameter

Top  Previous  Next

What is translated > 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);

->

typedef DynamicArray < String > strarray;

void __fastcall Check( const strarray& aSources);

 

 

In this case Delphi2Cpp 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 Delphi2Cpp Documentation

Delphi2Cpp home  Content