Difference between typedef struct and struct?

Viewed 755

I know the basic difference between them just have a doubt in particular situation like following:

struct books{
    int id;
    char* title;    
  }book;

book.id=9;    // this is valid;

But in case of typedef :

typedef struct books{
  int id;
  char*title;
}book;
book.id=9;    //it is not valid we have to do like book b1; then b1.id=9 is valid

What is going on here can u tell me?

1 Answers
Related