Article View: net.lang.c
Article #9660Why are typedef names in the same name space as variable names?
From: Donald L. Nash
Date: Mon, 27 Oct 1986 18:52
Date: Mon, 27 Oct 1986 18:52
24 lines
1363 bytes
1363 bytes
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@ngp.CC.UTEXAS.EDU
BITNET: CCEU001@UTADNX, DLNASH@UTADNX
Two wonderful facts to lighten your day:
1. The world is basically non-linear.
2. The entropy of the universe is increasing.
Technical Details
Message-ID:
<4220@ut-ngp.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!dlnashShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!ut-sally!ut-ngp!dlnash From: dlnash@ut-ngp.UUCP (Donald L. Nash) Newsgroups: net.lang.c,net.lang.c++ Subject: Why are typedef names in the same name space as variable names? Message-ID: <4220@ut-ngp.UUCP> Date: Mon, 27-Oct-86 13:52:05 EST Article-I.D.: ut-ngp.4220 Posted: Mon Oct 27 13:52:05 1986 Date-Received: Mon, 27-Oct-86 22:32:20 EST Organization: UTexas Computation Center, Austin, Texas Lines: 24 Keywords: typedef variable name space