A question about typedef!

Kevin Schmidt schmidt at mars.jpl.nasa.gov
Wed Nov 21 08:03:35 AEST 1990


In article <1990Nov20.153907.12373 at mathrt0.math.chalmers.se> d0thomas at dtek.chalmers.se (Thomas Lundqvist) writes:
>Hello! Could someone please tell me the difference between:
>
>struct TEST { int a; };
>
>typedef struct { int a; } TEST

Both structures are identical but references to the structure as a type are
different.  For the first case to declare a variable of that type you would
use:
	struct TEST x;
In the second case you would simply use:
	TEST x;

_______________________________________________________________________________
        _   ____    _   |                           |
       / / / _  \  / /  | Kevin T. Schmidt          | schmidt at mars.jpl.nasa.gov
      / / / /_/ / / /   | Jet Propulsion Laboratory | schmidt at jems.jpl.nasa.gov
 _   / / / ____/ / /    | 4800 Oak Grove Dr.        |
/ /_/ / / /     / /___  | M/S 301-355               |
\____/ /_/     /______/ | Pasadena, CA  91109       |



More information about the Comp.lang.c mailing list