C to D struct including LPVOID,LPCSTR
nobody
nobody at mailinator.com
Sun Sep 10 06:35:39 PDT 2006
Steve Horne wrote:
> On Sat, 09 Sep 2006 22:53:06 +0200, BLS <nanali at wanadoo.fr> wrote:
>
>> How do I translate : LPCSTR
>
> If you can change the type of the string, though, consider using
> char[] - a D string. It still operates as an array of characters, but
> D arrays are better.
>
> IIRC there is an implicit pointer in there (the string itself wouldn't
> end up in the struct) so the struct will still be the same size.
>
Just wanted to point out that D strings are structs with a pointer and a length.
C strings are just a pointer. So the size of a D string is twice that of a C
string which would change the size of the struct.
More information about the Digitalmars-d-learn
mailing list