Re: Set with Sort routine
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Tue, 27 Jun 2006 15:34:25 -0500
On Tue, 27 Jun 2006 13:12:46 -0400, Pete Becker <petebecker@xxxxxxx> wrote:
Doug Harrison [MVP] wrote:
Even in C, you should specify a tag, e.g.
// C only
typedef struct MyElem
{
int value;
} MyElem;
A tag is not required in C. The only time you need one as part of a
typedef like this is when the struct has a pointer to its own type. You
can't use the typedef name for that, since it hasn't been defined yet,
so you have to use the name of the tag, along with the struct keyword.
I said "you should specify a tag" (operative word being "should") because
ISTR using a compiler that would use the "real" type name in error
messages. For types lacking a tag, it would use an invented name, which
would make error messages hard to read.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: Set with Sort routine
- From: Pete Becker
- Re: Set with Sort routine
- References:
- Set with Sort routine
- From: Bruce Chastain
- Re: Set with Sort routine
- From: Doug Harrison [MVP]
- Re: Set with Sort routine
- From: Pete Becker
- Set with Sort routine
- Prev by Date: Re: Set with Sort routine
- Next by Date: Re: Set with Sort routine
- Previous by thread: Re: Set with Sort routine
- Next by thread: Re: Set with Sort routine
- Index(es):
Relevant Pages
|