Why are typedef names in the same name space as variable names?
BEATTIE
twb at hoqax.UUCP
Thu Nov 6 00:09:32 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++.
> Don Nash
To avoid things like:
foo foo;
Tom.
More information about the Comp.lang.c
mailing list