Addressing struct without ->

Doug Gwyn gwyn at smoke.brl.mil
Sat Jan 12 09:48:17 AEST 1991


In article <91010.084408NIBMSCM at NDSUVM1.BITNET> NIBMSCM at NDSUVM1.BITNET writes:
>... the 'using' keyword ...
>  Could anyone out there tell me how I can implement this in 'C' or
>which language products have added such a function ...

Since any such extension would be highly nonstandard, you really ought
to avoid using it.  It would provide no new functionality anyway, but
merely cater to your Pascal-based expectations.  C is not Pascal; it is
better.  The whole "using" approach is insufficiently general, since in
C different structure types can have the same member names, and often
do in practical source code.  Thus some form of disambiguation is needed
anyway, and this is already conveniently provided by use of the member
selection operators . and ->.  My suggestion is to learn to exploit this
rather than fight it.



More information about the Comp.lang.c mailing list