This one bit me today

Walter Bright bright at Data-IO.COM
Sat Oct 28 06:23:13 AEST 1989


In article <928 at sdrc.UUCP> mustard at sdrc.UUCP (Sandy Mustard) writes:
<SAS C on 370 has an option to allow the '@'
<character to indicate that the argument in a function call should be
<passed by reference.  It basically has the same meaning as the '&' but
<the '@' can be used on non-lvalues such as constants and expressions.
<char c;
<     func(&c, @20);
<will cause a pointer to a temporary copy of an int with a value of 20
<to be passed to the function.

Sounds silly to me. Why not just extend the compiler to have &20 mean
just that? The @ is not necessary if such behavior is desired.



More information about the Comp.lang.c mailing list