Use of struct and sizeof in C for Arduino
Consider the following:

void printBook(const books &amp;theBook)
{
    Serial.println("Name of the book is: ");
    Serial.println(theBook.name);
    Serial.println("author is: ");
    Serial.println(theBook.author);
    Serial.println("ID is: ");
    Serial.println(theBook.ID);
}

void loop()
{
    printBook(MyBook);
    printBook(YourBook);
}


You should appreciate this avoids the code duplication you have in your
example.


  Why I get 62 for the sizeof(Mybook)?



30 bytes for name[30] (each char is one byte)
30 bytes for author[30]
2 bytes for ID (the AVRs have 16-bit ints)


No padding between the members because this architecture has no
alignment constraints.