wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CSNP-04103 - Chapter 12 - C-Strings

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

The function "isspace" is part of the class:

a)

<string>

b)

<iostream>

c)

<cctype>

d)

<cstring>

2.

The function "isprint" is used for:

a)

Print to the screen

b)

Print to a file

c)

Detect if the argument is a printable character

d)

None of these answers.

3.

The function "tolower"

a)

Converts an uppercase argument to lowercase

b)

Reduces a number to its minimum expression

c)

Changes a numeric argument for its immediate lower numeric value

d)

Does not exist in C++

4.

A C-string is:

a)

a sequence of characters stored in adjacent memory locations and terminated by NULL character

b)

Is the same as a String

c)

It is an array of strings

d)

It is a dynamic vector or characters

5.

While working with C-Strings NULL is:

a)

Is a pointer to the first element of an array of characters

b)

Is used to indicate the end of a character

c)

Is the initial value of a pointer

d)

Is used to indicate the end of a string

6.

A C-String can be represented by

a)

A String literal

b)

A Pointer to a char

c)

An array of characters

d)

A Vector

7.

The function strlen is part of

a)

The <string> class

b)

The <iomanip> class

c)

The <cctype> class

d)

The <iostream> class

8.

The function <strcmp>:

a)

Compares strings stored at two addresses

b)

Compares strings stored at a adjacent addresses

c)

Compares 2 numbers

d)

None of the answers

9.

The function "stoi()":

a)

Is part of the <cctype> class

b)

Is part of the <string> class

c)

Converts a string to a long

d)

Does not exist in C++

10.

The function c_str():

a)

Converts a cstring into a string

b)

Converts an array of characters to a string

c)

Converts a string into a cstring

d)

Converts a integer into a string