Show: Delphi C++
Display Preferences

System.DynamicArray.Length

From XE2 API Documentation
Jump to: navigation, search

C++

__property    int Length = {read=get_length, write=set_length};

Contents

Properties

Type Visibility Source Unit Parent
property public sysdyn.h System DynamicArray

Description

Represents the number of elements in the DynamicArray.

Use the Length property to set or get the length of the dynamic array. The following code sets the length of a DynamicArray to 10.

DynamicArray<int> arrayOfInt;

arrayOfInt.Length = 10;
cout << "ArrayLength: " << arrayOfInt.Length << endl;

SetLength(arrayOfInt, 10);

To free a dynamic array, simply set its Length to 0:

arrayOfInt.Length = 0;

See Also

Code Examples


Personal tools
Previous Versions
Translations