0

Option 1:

typedef struct s{
                 int x;
                 double y;
                 char z;
                 }mystruct;

Option 2:

typedef struct {
                int x;
                double y;
                char z;
                }mystruct;

What's the difference between these 2 options?

1 Answers1

1

With option 1 you can declare a variable like this:

struct s foo;

or

mystruct foo;

With option 2 the only possibility is:

mystruct foo;
Jabberwocky
  • 48,281
  • 17
  • 65
  • 115