CH 11 - C++
Which of the following statements outputs the value of the gpa member of element 1 of the student array?
cout<<student[1].gpa;
This allows you to access structure members.
dot operator
Which of the following assigns a value to the hourlyWage member of employee[2]?
employee[2].hourlyWage = 100.00;
You may use a pointer to a structure as a
function parameter. structure member. function return type. All of these
This is required after the closing brace of the structure declaration.
semicolon
If a is a structure variable and p, a pointer, is a member of the structure, what will the following statement do? cout << *a.p;
Output the dereferenced value pointed to by p
A structure pointer contains:
The address of a structure variable
Data types that are created by the programmer are known as:
abstract data types (ADT)
This describes only the general characteristics of an object
abstraction
Members of a(n) ________ union have names, but the union itself has no name.
anonymous
When a structure is passed _________to a function, its members are not copied.
by reference
A structure _____________ contain members of the same data type
can
Before a structure can be used, it must be
declared
If an anonymous union is declared globally (outside all functions), it must be:
declared static
If Circle is a structure tag, the statement Circle *pcirc;
declares a structure pointer called pcirc
Passing a structure as a constant reference parameter to a function:
guarantees not to result in changes to the structure's members
With an enumerated data type, the enumerators are stored in memory as
integers
A function ___________ return a structure
may
The name of the structure is referred to as its
tag
If Circle is a structure tag, the statement can be the header line for a function that ____.
takes a Circle structure as a parameter, does something, and returns a Circle structure
To dereference a structure pointer, the appropriate operator is:
the structure pointer operator, ->
A good reason to pass a structure as a constant reference is:
to prevent changes to the structure members
This is like a structure, except all members occupy the same memory area
union
Which of the following is an example of a C++ primitive data type?
unsigned short int long double unsigned char All of these
Look at the following statement. The statement ______. bookList[2].publisher[3] = 't';
will store the character 't' in the fourth element of the publisher member of booklist[2].