Chapter 10 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What header file must you include in a program using character testing functions such as isalpha and isdigit?

A

cctype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What header file must you include in a program using the character conversion functions toupper and tolower?

A

cctype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What header file must you include in a program using string functions such as strlen and strcpy?

A

cstring

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What header file must you include in a program using string/numeric conversion functions such as atoi and atof?

A

cstdlib

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What header file must you include in a program using string class objects?

A

cstring

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you compare string class objects?

A

With standard relational operators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The ______ function returns true if the character argument is uppercase.

A

isupper

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The ______ function returns true if the character argument is a letter of the alphabet

A

isalpha

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The ______ function returns true if the character argument is a whitespace character

A

isspace

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The ______ function returns the uppercase equivalent of its character argument

A

toupper

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

the ______ function returns the lowercase equivalent of its character argument

A

tolower

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

the ______ file must be included in a program that uses character testing functions

A

cctype

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The ______ function returns the length of a string

A

strlen

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

To ______ two strings means to append one string to the other

A

concatenate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The _____ function concatenates two strings

A

strcat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The _____ function copies one string to another

A

strcopy

17
Q

The ______ function searches for a string inside of another one

A

strstr

18
Q

the ______ function compares two strings

A

strcmp

19
Q

The ______ function copies, at most, n number of characters from one string to another

A

strncopy

20
Q

The ______ function returns the value of a string converted to an integer

A

atoi

21
Q

The ______ function returns the value of a string converted to a long integer

A

atol

22
Q

The ______ function returns the value of a string converted to a float

A

atof

23
Q

The ______ function converts an integer to a string

A

itoa

24
Q

Character testing functions such as isupper, accept strings as arguments and test each character in the string. (T/F)

A

False

25
Q

If toupper’s argument is already uppercase, it is returned as is, with no changes. (T/F)

A

true

26
Q

If tolowers’s argument is already lowercase, it will be inadvertently converted to uppercase. (T/F)

A

False

27
Q

The strlen function returns the size of the array containing a string. (T/F)

A

False

28
Q

If the starting address of a C-string is passed into a pointer parameter, it can be assumed that all the characters, from that address up to the byte that holds the null terminator, are part of the string. (T/F)

A

True

29
Q

C-string handling functions accept as arguments pointers to strings (array names or pointer variables), or literal strings. (T/F)

A

True

30
Q

The strcat function checks to make sure the first string is large enough to hold both strings before performing the concatenation. (T/F)

A

False

31
Q

The strcpy function will overwrite the contents of its first string argument. (T/F)

A

True

32
Q

The strcpy function performs no bounds checking on the first argument. (T/F)

A

True

33
Q

There is no difference between “847” and 847. (T/F)

A

False