4 ms·
If Pascal had 1-based indexing, it wouldn't be possible to store the string length at index 0. The first character in a string is always at index 1 because of
by DonaldFisk 6y ago
If Pascal had 1-based indexing, it wouldn't be possible to store the string length at index 0. The first character in a string is always at index 1 because of this. Strings are
Packed Array[0..255] of Char
See https://www.pascal-programming.info/lesson10.php https://www.pascal-programming.info/lesson10.php
- clouddrover 6y agoPascal has both. Static arrays in Pascal can have arbitrary indexes with mixed data types: http://docwiki.embarcadero.com/RADStudio/Sydney/en/Structured_Types_(Delphi)#Arrays http://docwiki.embarcadero.com/RADStudio/Sydney/en/Structure... Examples: - var MyArray: array [1..100] of Char; - packed array[Boolean, 1..10, TShoeSize] of Integer; Dynamic arrays are indexed from zero.