Lesson 2 c++ II

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

After the following statement executes, what value is stored in the variable num? num = atoi("1000");

1000

To use the strlen function in a program, you must also write #include ________.

<cstring>

This library function reverses the order of a C-string.

None of these

This is the escape sequence representing the null terminator.

\0

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

atoi

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

atoi

This function accepts a C-string as an argument and converts the string to a long integer.

atol

Which of the following lines of code 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 determine whether a character entered is a letter of the alphabet, use this function.

isalpha

To test whether a character is a numeric digit character, use this function.

isdigit

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

isspace

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

lower case z

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

null character

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

strcat

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).

strlen

A library function that can find one C- string inside another is:

strstr

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

toupper

The strcpy function's arguments are:

two addresses

The statement: cah var1 = toLower('A'); will result in

var1 storing the ASCII value for lower case 'a


Set pelajaran terkait

Quiz-Molecular basis of inheritance

View Set

Organic Chemistry Lab- Superquiz 1

View Set

Ch.3 Attending and Empathy Skills

View Set

Frases Útiles para la Clase Virtual

View Set

chapter 3 working with financial statements

View Set

Pre-Licensing Insurance Course Chapter 16

View Set

Unit 2: Fire Safety and Utility Controls

View Set

Chapter 10 of TestOut 10.4 - 10.7

View Set