Ch 10, 11 C++

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

¿¿error??

What is the output of the following statement? cout << tolower(toupper('Z')) << endl;

by reference

When a structure is passed ________ to a function, its members are not copied

All of these

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

char str[50];

Which of the following lines of code defines an array of C-strings that will hold 49 characters and the null terminator?

cout<<student[0];

Which of the following statements outputs the value of the gpa member of element 1 of the student array?

integers

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

string

_________ is a generic term that describes a consecutive sequence of characters

instance

each structure variable is a separate __________

¿¿nothing??

given the code snippet: cout<< "What is your ID number?"; cin>> idnumber cout<< "What is your name?"; cin.getline(name, NAME_SIZE); what will be assigned to the variable 'name'?

strcat will append no more than 10 characters from string2 to the end of string1

when the following statement executes: strncat(string1, string2, 10);

large enough to hold all of the characters in both arrays

when the strcat function is used the first array must be _________

declared static

) If an anonymous union is declared globally (outside all functions), it must be ________.

dereference a pointer to a structure

-> is used to _________

to prevent changes to the structure members

A good reason to pass a structure as a constant reference is ________.

variables

C++ allows you to group several _______ into a structure

abstract data types (ADT)

Data types that are created by the programmer are known as ________.

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

If Circle is a structure tag, the statement: Circle doSomething(Circle c2) can be the header line for a function that ________.

Output the dereferenced value pointed to by p.

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;

strongly typed enum

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.

null character

In C++, a C-string is a sequence of characters stored in consecutive memory, terminated by a ________.

false

Look at the following declaration. enum Tree { OAK, MAPLE, PINE }; What is the value of the following relational expression? OAK > PINE

¿¿ both a & c ??

Look at the following statement. if (!isdigit(var1)) The expression being tested by this statement will evaluate to true if var1 is:

anonymous

Members of a(n) ________ union have names, but the union itself has no name.

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

Passing a structure as a constant reference parameter to a function ________

data type

The name of the structure is referred to as its ________.

::

The symbol for the scope resolution operator is _____ .

abstraction

This describes only the general characteristics of an object.

atoi

This function accepts a C-string containing a number as its argument and returns the integer equivalent.

strlen

This function accepts a pointer to a C-string as an argument, and it returns the length of the C-string (not including the null terminator).

strcat

This function concatenates the contents of one C-string with another C-string.

atoi

This function converts a C-string to an integer and returns the integer value.

union

This is like a structure, except all members occupy the same memory area

toupper

To change a character argument from lower to upper case, use this function.

char lastName[26];

To define a C-string that will store students' last names of up to 25 characters in length, which is an appropriate statement?

the structure pointer operator, ->

To dereference a structure pointer, the appropriate operator is ________.

isalpha

To determine whether a character entered is a letter of the alphabet, use this function.

isspace

To determine whether a character is whitespace, use this function.

isprint

To test whether a character is a printable character, use this function.

are data types created by the programmer

abstract data types ___________

primitive data types

bool, char, and float would be examples of _________

have to define a character array large enough to hold it plus one character

if you want to store a C-string in memory you _________

C-string

in C++ a ________ is a sequence of characters stored in consecutive memory locations terminated by the null character

is a mechanism for creating abstract data types

in C++ the structure _________

structures

in order to improve efficiency it is often preferred to pass large objects such as ________ reference in order to avoid making a copy of it

possible

it is _______ to create an array of structures

structure

it is possible to define multiple _______ variables in a program

processed using standard subscript notation

once a string is stored in an array it can be ________

dot

the ________ operator allows you to address/access structure members in a program

structure variables

the address of ________ may be used to make pointers to structures

higher precedence

the dot operator has __________ the indirection operator

accept a single character argument

the functions toupper, and tolower each ________

values when the structure is defined

the members of structure variables may be initialized with ________

tag

the name of a structure is its ________

pointer to a

the strlen function accepts a _________ C-string as its argument

->

the structure pointer operator ___________

provide an initialization list for one or more of the elements

to initialize a structure array __________

<cstring> directive

to use the standard template library functions designed to process C-strings you must include the _________

don't actually cause the character argument to change

toupper and tolower __________ to change

cannot

you ______ perform comparison operations on structure varaibles


Ensembles d'études connexes

College Physics II: Module 3 & Module 4

View Set

NUR 145 - Module A: Practice Questions

View Set

Spanish exam study guide, Spanish II - Preterite regular and irregular verbs, Spanish II- Verbs, Los verbos reflexivos - presente, Infinitive expressions, Preterite Clue Words, Senderos 2 Comparisons, Spanish Indirect Object Pronouns, Spanish Indirec...

View Set

Romeo and Juliet paragraph translations

View Set

Chapter 26 nonopioid and opioid analgesics

View Set

Business Finance Ch 10 Quiz - Connect

View Set

Chapter 11 Criminal Justice Definitions

View Set

CHAPTER 1 STUDY GUIDE HEALTH INS.

View Set

COURSERA GOOGLE IT SUPPORT: WEEK 1

View Set

Health 110 ch 1 the power of now

View Set