C++ Ch 10 - Characters, C-Strings, and More about the string Class

Ace your homework & exams now with Quizwiz!

C++11 introduces a function named to_string that converts a numeric value to astring object.

True

The C++ library provides functions for converting a string representation of a number to a numeric data type and vice-versa.

True

The itoa function is similar to atoi but it works in reverse.

True

The escape sequence that represents the null terminator is

\0

Which of the following converts the string "10" to the integer value 10?

atoi("10");

The function that accepts a C-string as an argument and converts the string to a long integer is

atol

The expression being tested by the statement shown below will evaluate to true ifvar1 is ________.if (!isdigit(var1))

both an alphabetic character and a symbol such as $ or &

Which of the following statements appropriately defines a C-string that stores names of up to 25 characters?

char name[26];

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

char str[50];

The C-string company[12] can hold

eleven characters and the null terminator

To test whether a character is a printable character, use the ________ function.

isprint

Which of the following will return true if the argument is a printable character other than a digit, letter, or space?

ispunct

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

strcat

The function that accepts a pointer to a C-string as an argument and returns the length of the C-string, not including the null terminator is

strlen

In C++11, assuming mychar is a char variable and mystring is a string, what is the value of mychar after the following statement executes?mychar = mystring.front();

the first character of mystring

The arguments of the strcpy function are

two addresses

The function that reverses the order of a C-string is

None of these

A test using the isupper function will return false if the argument is an uppercase character.

False

The strlen function returns a C-string's length and adds one for \0. Question 11 options:

False

The null terminator stands for ASCII code

0


Related study sets

Introduction to Business - Final

View Set

Network+ Guide to Networks 7th ed. Quiz Ch. 10

View Set

Conflicts of Interest end of course quiz

View Set

Chapter 13 - Cardiac Arrhythmias And Their Electrocardiographic Interpretation

View Set

48-Hour Contracts and Regulations Course

View Set