Chapter 11 Quiz

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

given the following structure declaration, idNum is struct Employee { string name; int idNum; };

a member

which of the following statements outputs the value of the gpa member of element [1] of the student array?

cout << student[1].gpa;

a declaration for an enumerated type begins with the _________ key word

enum

given the following declaration: enum Tree { OAK, MAPLE, PINE }; what is the value of the following relational expression? OAK > PINE

false

you may use a pointer to a structure as a

function parameter, structure member, function return type

Passing a structure as a constant reference parameter to a function

guarantees not to result in changes to the structure's members

which of the following describes only the general characteristics of an object?

abstraction

a structure _______ contain members of the same data type

can

With an enumerated data type, the enumerators are stored in memory as

integers

if Circle is a structure, what does the following statement do? Circle *pcirc = nullptr;

it declares a structure pointer called pcirc initialized with a null pointer

a function __________ return a structure

may

the name of a structure is referred to as its

none of these

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

in C++11, you can use a new type of enum known as a(n) ________ (also known as an enum class) to have multiple enumerators with the same name, within the same scope

strongly typed enum

if circle is a structure tag, then the following statement can be the header line for a function that ___________ Circle doSomething(Circle c2)

takes a Circle structure as a parameter, does something, and returns a Circle structure

to dereference a structure pointer, the appropriate operator is

the -> operator (structure pointer)

a structure pointer contains

the address of a structure variable

which of the following will allow you to access structure members?

the dot operator

a good reason to pass a structure as a constant reference is

to prevent changed to the structure's members

which of the following is an example of a C++ primitive data type?

unsigned short int, long double, unsigned char


Ensembles d'études connexes

Microeconomics Chapter 10.2-book notes- PROFIT-MAXIMIZING OUTPUT FOR THE MONOPOLIST

View Set

Astronomy Ch 4 - Light and Atoms

View Set

COSC 1336 Chapter 4 Decisions Quiz Part B

View Set