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?
bookof typestruct books. The second defines a type aliasbookto the typestruct books, but no variable. Sayingbook.id = 9here is like sayingfloat = 1.2f.