Struggling with wchar[] to string conversion

Adam D. Ruppe destructionator at gmail.com
Tue Jan 19 16:01:03 UTC 2021


On Tuesday, 19 January 2021 at 15:32:12 UTC, Stefan wrote:

> contains a szExePath member that is a wchar[260].
> Converting this to a string succeeds (compiler does not 
> complain) with
> me32.szExePath.text

You need to slice it on length. That default conversion will 
include all 260 chars.

So you probably need to scan it for zeroes with wstrlen or 
whatever first.


More information about the Digitalmars-d-learn mailing list