Is there a way in Delphi declaring an array of strings such as following one?
{'first','second','third'}
In C#, use readonly to declare a const array. public static readonly string[] a = { "Car", "Motorbike", "Cab" }; In readonly, you can set the value at runtime as well unlike const.
Here is how an array of C string can be initialized: #define NUMBER_OF_STRING 4 #define MAX_STRING_SIZE 40 char arr[NUMBER_OF_STRING][MAX_STRING_SIZE] = { "array of c string", "is fun to use", "make sure to properly", "tell the array size" };
In C++, the most common way to define a constant array should certainly be to, erm, define a constant array: const int my_array[] = {5, 6, 7, 8};
try this
Const Elements =3; MyArray : array [1..Elements] of string = ('element 1','element 2','element 3');
In XE7 you can declare a dynamic array constant like this:
const MyArray: TArray<String> = ['First','Second','Third'];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With