Chapter 10 Flashcards
What header file must you include in a program using character testing functions such as
isalpha and isdigit ?
cctype
What header file must you include in a program using the character conversion functions
toupper and tolower ?
cctype
Assume c is a char variable. What value does c hold after each of the following statements
executes?
Statement Contents of c
c = toupper(‘a’); ___________
c = toupper(‘B’); ___________
c = tolower(‘D’); ___________
c = toupper(‘e’); __________
‘A’
‘B’
‘d’
‘E’
Look at the following code. What value will be stored in s after the code executes?
char name[10];
int s;
strcpy(name, “Jimmy”);
s = strlen(name);
5
What header file must you include in a program using string functions such as strlen and
strcpy ?
cstring
What header file must you include in a program using string/numeric conversion functions
such as atoi and atof ?
cstdlib
- What header file must you include in a program using string class objects?
string
- How do you compare string class objects?
With the standard relational operators.
The _________ function returns true if the character argument is uppercase.
isupper
- The _________ function returns true if the character argument is a letter of the alphabet.
isalpha
- The _________ function returns true if the character argument is a digit.
isdigit
- The _________ function returns true if the character argument is a whitespace character.
isspace
- The _________ function returns the uppercase equivalent of its character argument.
toupper
- The _________ function returns the lowercase equivalent of its character argument.
tolower
- The _________ file must be included in a program that uses character testing functions.
cctype
- The _________ function returns the length of a string.
strlen
- To _________ two strings means to append one string to the other.
concatenate
- The _________ function concatenates two strings.
strcat