Do we really need const?

Janice Caron caron800 at googlemail.com
Tue Sep 18 03:45:02 PDT 2007


On 9/18/07, Regan Heath <regan at netmail.co.nz> wrote:
> Bill Baxter wrote:
> > Regan Heath wrote:
> >> renoX wrote:
> >>> Bruce Adams a écrit :
> >>>> An example of one that catches me out quite often is:
> >>>> strcpy(src,dest) vs. strcpy(dest,src);
> >>>
> >>> Let's try it: do you think you would make the same mistake if you
> >>> would call your function this way:
> >>> char[50] var_dest, my_src;
> >>> strcpy(dest: var_dest, src: my_src)
> >>
> >> My eyes... aaarghh!
> >
> > Is it the particular syntax or the concept you object to?
>
> Not sure, it just makes my skin crawl at the moment.

Of course, for copying strings in D, we already have the vastly superior syntax
dst = src;

:-)




More information about the Digitalmars-d mailing list