Cannot cast char[] to string.

Dicebot public at dicebot.lv
Thu Nov 14 11:43:04 PST 2013


On Thursday, 14 November 2013 at 19:41:13 UTC, Agustin wrote:
> I'm trying to use http://dlang.org/phobos/std_net_curl.html and 
> when i compile the same example i get:
>
> cannot implicitly convert expression 
> (get(cast(const(char)[])address, AutoProtocol())) of type 
> char[] to string
>
> string address = "http://dlang.org";
> string _data = get(address);

`get` returns mutable data, one should respect it:

char[] data = get(address); // or just use `auto data = `


More information about the Digitalmars-d-learn mailing list