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

John Myers jgm at spice.cs.cmu.edu
Fri Nov 14 10:50:46 AEST 1986


Keywords:


In article <4220 at ut-ngp.UUCP> dlnash at ut-ngp.UUCP (Donald L. Nash) writes:
>Why are typedef names in the same name space as variable names?...

If they weren't, then what would the output of the following program be?

#include <stdio.h>
main()
{
    typedef car foo;
    long foo;
    
    printf("%d\n",sizeof(foo));
}



More information about the Comp.lang.c mailing list