Static array parameter

Top  Previous  Next

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


A static array is passed to functions as an open array parameter. The additional second parameter for the upper bound of the array is inserted into the declaration of the function automatically and is passed to the function automatically too. The upper bound of the array is calculated by means of a macro:


#define MAXIDX(x) (sizeof(x)/sizeof(x[0]))-1



procedure foo(Arr: Array of Char)

begin end;


procedure bar();


   chararray : Array [1..10] of Char;





is translated to:


public static void foo(char[] Arr)




public static void bar()


  char[] charArray = new char[10/*# range   1..  10*/];






This page belongs to the Delphi2C# Documentation

Delphi2C# home  Content