Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mit-eddie!genrad!decvax!mcnc!rti-sel!dg_rtp!throopw From: throopw@dg_rtp.UUCP (Wayne Throop) Newsgroups: comp.lang.c Subject: Re: structure element offsets Message-ID: <736@dg_rtp.UUCP> Date: Mon, 8-Dec-86 10:59:49 EST Article-I.D.: dg_rtp.736 Posted: Mon Dec 8 10:59:49 1986 Date-Received: Wed, 10-Dec-86 02:45:58 EST References: <1096@spice.cs.cmu.edu> <768@nike.UUCP> <3622@watmath.UUCP> <386@viper.UUCP> <3695@watmath.UUCP> <419@viper.UUCP> Lines: 27 > dave@viper.UUCP (David Messer) > for good or ill, > C has been defined such that all members-of-structures share the > same name-space. You're wrong, you know. Members of structures do NOT share the same namespace in C, no more than =+ is an operator in C. Let us chant together, from Harbison and Steele, page 107: The names of structure components are defined in a special overloading class associated with the structure type. That is, component names within a single structure must be distinct, but they may be the same as component names in other structures and may be the same as variable, function, and type names. Kernighan and Ritchie have similar things to say, but I don't (GASP) have my K&R to hand just now to find what they are, though I recall vaguely that they explain that the historical crock that some compilers (that aren't C compilers, mind you:-) make structure members of all structure types a single namespace. This historical oddity should not be confused with a linguistic feature. -- A LISP programmer knows the value of everything, but the cost of nothing. --- Alan J. Perlis -- Wayne Throop !mcnc!rti-sel!dg_rtp!throopw