case sensitive identifiers (Was: Re: Just Wondering)

Bjorn Engsig bengsig at oracle.nl
Wed Apr 26 23:04:02 AEST 1989


In article <1314 at ns.network.com> ddb at ns.UUCP (David Dyer-Bennet) writes:
>
>How DO people feel about identifiers differing only in casing?  Is this
>ok?  To be COMPLETELY avoided?  To be avoided except in a very few
>well-understood conventional cases?
>
One of the more common cases where you use identifiers only different in case 
is for union fields inside structures, e.g.:

struct abc {
  int a, b, c;
  union {
    char Array[4];
    long Whole;
    } wa_union;
  };

#define array wa_union.Array
#define whole wa_union.Whole

which allows you to rerefence the union fields in your program without
having to supply the union name, i.e.  abcvar.array[2]  in stead of 
abcvar.wa_union.Array[2].
-- 
Bjorn Engsig, ORACLE Europe         \ /    "Hofstadter's Law:  It always takes
Path:   mcvax!orcenl!bengsig         X      longer than you expect, even if you
Domain: bengsig at oracle.nl           / \     take into account Hofstadter's Law"



More information about the Comp.lang.c mailing list