O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Review Questions

1:What's wrong with this template?
structure {
       char itable;
       int  num[20];
       char * togs
}
2:Here is a portion of a program. What will it print?
#include <stdio.h>
struct house {
    float sqft;
    int rooms;
    int stories;
    char address[40];
} ;
int main(void)
{
  struct house fruzt = {1560.0, 6, 1, "22 Spiffo Road"} ;
  struct house *sign;

  sign = &fruzt;
  printf("%d %d\n", fruzt.rooms, sign->stories);
  printf("%s \n", fruzt.address);
  printf("%c %c\n", sign->address[3], fruzt.address[4]);
  return 0;
}
3:Devise a structure template that will hold the name of a month, a three-letter abbreviation for the month, the number of days in the month, and the month number.
4:Define an array of 12 structures of the sort in question 3 and initialize it for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required