Do we really need const?

Regan Heath regan at netmail.co.nz
Mon Sep 17 14:57:05 PDT 2007


renoX wrote:
> Bruce Adams a écrit :
>> An example of one that catches me out quite often is:
>> strcpy(src,dest) vs. strcpy(dest,src);
> 
> If it helps you'not the only one to have this kind of issue: some 
> compilers even try to detect when people makes mistakes for 'memset'?
> Both case show why function calls with passing the parameter by position 
> instead of by keywords *sucks*.
> 
> 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!

Regan



More information about the Digitalmars-d mailing list