Re: single loop copy in D

2018-03-02 Thread psychoticRabbit via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:08:57 UTC, Simen Kjærås wrote: This is of course only partly true. while ((*dst++ = *src++) != 0) {} works just great, and also better shows what's actually being tested for in the loop. -- Simen That's what I was after. Thanks!

Re: single loop copy in D

2018-03-02 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 2 March 2018 at 10:01:34 UTC, Jonathan M Davis wrote: On Friday, March 02, 2018 09:44:20 psychoticRabbit via Digitalmars-d-learn wrote: trying to do this C code, in D, but getting error: "Error: assignment cannot be used as a condition, perhaps `==` was meant?" any help much apprecia

Re: single loop copy in D

2018-03-02 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 2 March 2018 at 09:44:20 UTC, psychoticRabbit wrote: trying to do this C code, in D, but getting error: "Error: assignment cannot be used as a condition, perhaps `==` was meant?" any help much appreciated: -- while ((*dst++ = *src++)) {} -- You can't use this syntax insid

Re: single loop copy in D

2018-03-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 02, 2018 09:44:20 psychoticRabbit via Digitalmars-d-learn wrote: > trying to do this C code, in D, but getting error: > "Error: assignment cannot be used as a condition, perhaps `==` > was meant?" > > any help much appreciated: > > -- > while ((*dst++ = *src++)) {} > -- Y

single loop copy in D

2018-03-02 Thread psychoticRabbit via Digitalmars-d-learn
trying to do this C code, in D, but getting error: "Error: assignment cannot be used as a condition, perhaps `==` was meant?" any help much appreciated: -- while ((*dst++ = *src++)) {} --