Re: Typedef or not



Ronny Mandal <ronnyma@xxxxxxxxxxx> wrote:

Typedef struct { int foo, bar } FooBar;

struct FooBar { int foo, bar };

What woul be the only difference here; just that I can create new
instances by 'Foobar fb, *pfb', and the second demands that I prefix with
struct? struct FooBar fb, *pfb?

Yes. There are, IYAM, only two cases in which this is useful:

- you are lazy and do not care about clarity;
- you are defining an abstract data type.

Richard
.