2 ms·
An ANSI/UTF-8 Reference Counted strings library for C. In Free Pascal, the AnsiString type is a reference counted string, which can contain up to 2 billion cha
by mikewarot 5y ago
An ANSI/UTF-8 Reference Counted strings library for C.
In Free Pascal, the AnsiString type is a reference counted string, which can contain up to 2 billion characters, and you never have to allocate/deallocate them. These strings can contain any binary data, including nul, with the length of the string being counted as well. If you modify the string, it first checks the reference count, if it's 1, nothing needs to be done, if more than 1, it copies it first.
There is an equivalent WideString type as well as traditional pChar, etc.
C could really use a modern string type.