Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!swift.cs.tcd.ie!mbrennan From: mbrennan@swift.cs.tcd.ie Newsgroups: comp.lang.c Subject: Re: A question about typedef! Message-ID: <1990Nov22.133716.7529@swift.cs.tcd.ie> Date: 22 Nov 90 13:37:16 GMT References: <1990Nov20.153907.12373@mathrt0.math.chalmers.se> Organization: Computer Science Department, Trinity College Dublin Lines: 17 In article <1990Nov20.153907.12373@mathrt0.math.chalmers.se>, d0thomas@dtek.chalmers.se (Thomas Lundqvist) writes: > Hello! Could someone please tell me the difference between: > > (1) struct TEST { int a; }; > > (2) typedef struct { int a; } TEST With case (1) you would delcare a variable: struct TEST foo ; but with case (2) you would write TEST foo ; In case (1) the words "struct TEST" together are a type, in the same way as int, char long etc are types, but with case (2) the word "TEST" on it's own is a type. -- , , , , , , , , , , Micheal O Braonain Roinn Riomheolaiochta, Colaiste Na Trinoide, BAC 2. Email mbrennan@cs.tcd.ie