Chapter 14

  1. The proper keyword is struct, not structure. The template requires either a tag before the opening brace or a variable name after the closing brace. Also, there should be a semicolon after * togs and at the end of the template.

  2. Here is the output:

    6 1
    22 Spiffo Road
    S p
    
  3. struct month {
        char name[10];
        char abbrev[4];
        int days;
        int monumb;
    };
    
  4. struct month months[12] =
    {
        {"January", "jan", 31, 1},
        {"February", "feb", 28, 2},
        {"March", "mar", 31, 3},
        {"April", "apr", 30, 4},
        {"May", "may", 31, 5},
        {"June", "jun", 30, 6},
        {"July", "jul", 31, 7},
        {"August", "aug", 31, 8},
        {"September", "sep", 30, 9},
        {"October", "oct", 31, 10},
        {"November", "nov", 30, 11},
        {"December", "dec", 31, 12}
    };
    
  5.  extern struct month months[]; int days(int month) ...

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.