Why have xxx_t typedef names (was Re: Is typedef char BUFFER[20] legal?)

Stephen J Bevan bevan at cs.man.ac.uk
Wed Jan 30 19:42:05 AEST 1991


In article  <1991Jan29.210100.8105 at zoo.toronto.edu>
henry at zoo.toronto.edu (Henry Spencer) writes :
> In article <1212 at tredysvr.Tredydev.Unisys.COM>
> paul at tredysvr.Tredydev.Unisys.COM (Paul Siu) writes:
> >Can anyone also tell me what is the most common style convention for type
> >names, I usually put them all in capitals.
> 
> Insofar as there is a consensus, it's to put them in lower case with a
> suffix "_t", e.g. "uid_t" as the type for userids.

What is the purpose of the "_t" ... etc. postfixes ?
It obviously makes any variables defined by a typedef'd type very
clear, but is that important?  I think not.

``Recommended C Coding Standards''(v5.3) mentions them in section 11, but
only says ``Typedeffed names often have "_t" appended to their name''.

I'm still left with the question, why have postfixes?

Stephen J. Bevan		bevan at cs.man.ac.uk



More information about the Comp.lang.c mailing list