Why are typedef names in the same name space as variable names?

Donald L. Nash dlnash at ut-ngp.UUCP
Tue Oct 28 04:52:05 AEST 1986


Why are typedef names in the same name space as variable names?  In C
this presents very few problems, but in C++ it causes problems.  Since
class names are implicitly made into typedef names, they are also in the
same name space as variable names.  This means that you cannot have
something like:

	struct foo { /* ... */ };

	int foo;

in C++.

I know it is really too late to change anything, but I'm still curious why C
was made this way.  Speak up, BWK and DMR!!! :-)  Flames to /dev/null, please.

				Don Nash

UUCP:    ...!{ihnp4, allegra, seismo!ut-sally}!ut-ngp!dlnash
ARPA:    dlnash at ngp.CC.UTEXAS.EDU
BITNET:	 CCEU001 at UTADNX, DLNASH at UTADNX

    Two wonderful facts to lighten your day:
        1.  The world is basically non-linear.
        2.  The entropy of the universe is increasing.



More information about the Comp.lang.c mailing list