Character and String Manipulation Flashcards

1
Q

is usually declared as an array of char.

A

C-String

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

A valid C string requires

A

the presence of a terminating “null
character” (a character with ASCII value 0, usually represented by the character literal ‘\0’).

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

declares a set of functions to
work with C-style string

A

The C++ <cstring> header file</cstring>

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

copies character string from source to destination

A

strcpy

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

copies specified bytes of characters from source to destination.

A

strncpy

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

appends a copy of a string to the end of another string

A

strcat

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

appends a specified number of characters of a string to the end of another string

A

strncat

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

returns length of given string

A

strlen

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

compares two null terminating string. The
comparison is done lexicographically.

A

strcmp

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

compares a specified number of characters of two null terminating strings. The comparison is done lexicographically.

A

strncmp

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

can be used to read a line of input
and place the string of characters on that line into a C-string variable.

A

getline

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

allows your program to read in one character
of input and store it in a variable of type char

A

get function

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

This function member is analogous to the member function get except that it is used for output rather than input.

A

put function

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

allows your program to output one
character

A

put function

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

This header declares a set of functions to classify and transform individual characters.

A

C++ <cctype></cctype>

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

Convert uppercase letters to lowercase

A

tolower

17
Q

Convert lowercase letter to uppercase

A

toupper

18
Q

Check if character is uppercase letter

A

isupper

19
Q

Check if character is lowercase letter

A

islower

20
Q

Check if character is alphabetic

A

isalpha

21
Q

Check if character is decimal digit

A

isdigit

22
Q

Check if character is alphanumeric

A

isalnum

23
Q

Check if character is a white space

A

Isspace

24
Q

Check if character is a punctuation character

A

ispunct

25
Q

Check if character is printable

A

isprint

26
Q

Check if character has graphical representation

A

isgraph

27
Q

Check if character is a control character

A

Isctrl