Kevin A. Foss wrote:
I assume something like:
Var foo : CString; [...] begin New(foo, 3); { or } GetMem(foo, 3);
To get 3 bytes of string space right?
The second.
Do I have to worry about enough space for the null, [...] ?
Yes.
Dealing with `CString's in GPC is like programming in C. `GetMem (foo, 3)' (or - GPC extension - `foo:= GetMem (3)') replaces the `foo = malloc()'. You have to `move' the characters from the Pascal string to the C string because a simple assignment re-assigns the pointer (the CString variable).
Peter