September 2001
Beginner
970 pages
23h 20m
English
| 1: | What's wrong with this template?
structure {
char itable;
int num[20];
char * togs
}
|
| A1: | 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 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;
}
|
| A2: | Here is the output: ... |
Read now
Unlock full access