Comment by badsectoracula
15 days ago
The original Pascal didn't had a string type, that was introduced by various dialects.
FWIW all Pascal dialects since the 90s have a string type that allows more than 255 bytes. In Free Pascal strings are pointers to the first character with a header in a negative offset indicating the length, reference count and codepage (these fields are aligned depending on the CPU). For C compatibility the string is also null terminated so you can pass such a string to a C function and it'll work as expected. AFAIK Delphi also does the same.
No comments yet
Contribute on Hacker News ↗