GC seems to crash my C-code function

frame frame86 at live.com
Sat Sep 18 21:16:13 UTC 2021


On Saturday, 18 September 2021 at 18:48:07 UTC, Steven 
Schveighoffer wrote:
> Are you defining the prototype for strchr yourself instead of 
> importing it from core.stdc.string?

Not really :D but without cast it complains:
```
Error: cannot implicitly convert expression strchr(e, cast(int)c) 
of type const(char)* to char*
```

> Did you mean "long to char" cast? In that case, yes, you have 
> to cast it.
>
> Note, `out` is a keyword, it can't be used as a variable, but 
> you probably already figured that out. But if `out` here is a 
> `char *`, then yes, you need a cast there.
>
> -Steve

Yes, of course. `out(put)` is a `char[6]` here.



More information about the Digitalmars-d-learn mailing list