Answers 857
F
Answers for Day 11
Quiz
- The data items in an array must all be of the same type. A structure can contain
data items of different types. - The structure member operator is a period. It is used to access members of a struc-
ture.
3.struct - A structure tag is tied to a template of a structure and is not an actual variable. A
structure instance is an allocated structure that can hold data. - These statements define a structure and declare an instance called myaddress. This
instance is then initialized. The structure member myaddress.nameis initialized to
the string “Bradley Jones”,yaddress.add1is initialized to “RTSoftware”,myad-
dress.add2is initialized to “P.O. Box 1213”,myaddress.cityis initialized to
“Carmel”,myaddress.stateis initialized to “IN”, andmyaddress.zipis initial-
ized to “46032-1213”.
6.word myWord; - The following statement changes ptrto point to the second array element:
ptr++;
Exercises
- The code is as follows:
struct time {
int hours;
int minutes;
int seconds;
} ; - The code is as follows:
struct data {
int value1;
float value2;
float value3;
} info ;
3.info.value1 = 100;
- The code is as follows:
struct data *ptr;
ptr = &info;
49 448201x-APP F 8/13/02 11:22 AM Page 857