Dynamic arrays

Top  Previous  Next

What is translated > Types > Arrays > Dynamic arrays

Delphi2C# represents Delphi dynamic arrays using normal C# arrays.

 

A Delphi declaration such as:

 

var

  Values: array of Integer;

 

is translated to:

 

int[] Values = default;

 

A C# array already provides several important properties of a Delphi dynamic array:

 

•arrays are reference types;
•array assignment shares the same storage;
•indexing is zero-based;
•arrays expose a Length property;
•jagged arrays can represent nested Delphi dynamic arrays;
•arrays can be converted directly to spans;
•arrays can be used by the Delphi2C# pointer runtime.

 

 

 



This page belongs to the Delphi2C# Documentation

Delphi2C# home  Content