[Lazarus] strcat problem

Koenraad Lelong lazarus2 at de-brouwerij.be
Thu Jun 23 21:27:19 CEST 2016


Op 23-06-16 om 21:08 schreef Koenraad Lelong:
> Op 23-06-16 om 16:58 schreef David W Noon:
>> [snip]
>>> cTekst:=#13'Now is the winter of our discontent'#13;
>>
>> You need a trailing #0 byte on the end.
>>
>
> The definition of cTekst :
> var
>     cTekst : PChar;
>
> So the compiler knows cTekst is a 0-terminated string doesn't, it ?
> And StrCat needs two parameters : PChar and PChar. So I think the
> compiler knows the strings are zero-terminated.
> Besides, on my OpenSuse-box it works, or is that by chance ?
>
> Koenraad.
>
Extra info :
I checked with a hex-dumper (executables for opensuse & pi). All strings 
end with a #0. No byte-count in front of them. All start at a 
longword-boundary.

Koenraad




More information about the Lazarus mailing list