Ch. 10 Characters, C-strings and More About the string Class Flashcards

1
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
2
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
3
Q

The _______ function returns true if the character argument is a digit.

A

isdigit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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
5
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
6
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
7
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
8
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
9
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
10
Q

The ________ function concatenates two strings.

A

strcat

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

The ________ function copies one string to another.

A

strcopy

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

The ________ function searches for a string inside of another one.

A

strstr

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

The _______ function compares two strings.

A

strcmp

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

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

A

strncopy

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

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

A

atoi

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

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

A

atol

17
Q

The _______ function returns the value of a string converted to a float.

A

atof

18
Q

The _______ function converts an integer to a string.

A

itoa

19
Q

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

A

False

20
Q

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

A

True

21
Q

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

A

False

22
Q

The strlen function returns the size of the array containing a string.

A

false, length not size

23
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

24
Q

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

A

True

25
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, no bound checking in C++

26
Q

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

A

True

27
Q

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

A

True

28
Q

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

A

False