In C, I can declare and initialize a char array as follows:
char arg[10] = "ANY";
Is there a short syntax to do the same in delphi?
Constant:
const arg: array[0 .. 9] of AnsiChar = 'ANY';
Local variable:
var arg: array[0 .. 9] of AnsiChar; ... arg := 'ANY';
Global variable:
var arg: array[0 .. 9] of AnsiChar = 'ANY';
something like that:
var arg1: string = 'any';
or
var arg2: packed array [0..9] of char = 'any';
if you really need an array starting at index 0, as in C, or
var arg3: pchar = 'any';
if you want a line ending with \ 0
Source: https://habr.com/ru/post/1795178/More articles:How to use AsyncTask - androidSIP implementation for Android2.3 - androidNhibernate + Spring.Net + Transaction + Too Many Threads - nhibernateHTMLUnit rejects cookie - javaImage / HTML return using custom URI on Android - androidIs there a hotkey for jumping between braces? - javaScala eq questions - scalaBinding a sequence of events using a FOR loop - javascriptmultiple classes in one physical file on android - javaRegistering multiple package versions with `ghc-pkg`? - haskellAll Articles