Re: typedefing a struct
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Fri, 14 Sep 2007 13:22:23 -0700
"Charlie Gordon" <news@xxxxxxxxxxx> writes:
[...]
I guess the real question is what convention to follow for naming
structures and other types. The _t suffix is in wide use and
recognized by editors, but it violates POSIX constraints. Using an
initial capital is also in wide use in OOP but give C code a bad smell
of java. Using all caps would be consistent with FILE and Microsoft C
based APIs but looks ugly. I cannot settle for one over the others...
A digression:
I suspect the reason FILE is in all-caps is that it was invented
before typedefs were introduced to the language, and thus must have
originally been a macro. When typedefs were invented, it was too late
to change it.
The definition might have been something like:
struct file { /* ... */ };
#define FILE struct file
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- References:
- typedefing a struct
- From: David Marsh
- Re: typedefing a struct
- From: Chris Thomasson
- Re: typedefing a struct
- From: Army1987
- Re: typedefing a struct
- From: Charlie Gordon
- typedefing a struct
- Prev by Date: Re: strftime() behaviour
- Next by Date: Re: Bug in SosMan's getline_test
- Previous by thread: Re: typedefing a struct
- Next by thread: Re: typedefing a struct
- Index(es):