C Chapter 12 Word Scramble
|
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.
Normal Size Small Size show me how
Normal Size Small Size show me how
| Question | Answer |
| In C++, you can use the ____ function to determine the number of character contained in a string variable. | length() |
| What is the syntax for the length function? | string.length() |
| In C++, you can use the ___ function to remove one or more characters located anywhere in a string variable. | erase() |
| In an erase function ___ refers to the unique number assigned to each character contained in the string variable; the number indicates the character position in the string. | Subscript |
| What is the syntax for the erase function? | string.erase(subscript[, count]) |
| If you omit the ___ argument, the erase function removes all characters from the subscript position through the end of the string. | count |
| You can use the ___ function to access any number of characters contained in a string variable. | substr() |
| The arguments in a substr() function can be ___ or ___ | numeric literal contants, names of numeric variables. |
| In C++, you can use the __ function to insert characters within a string variable. | insert() |
| In C++ you can use the ___ function to search a string variable to determine whether it contains a specific sequence of characters. | find() |
| If the searchstring is found(in a find() function), the value will be greater than or equal to 0. TRUE/FALSE? | TRUE |
| If the searchstring is not found(in a find function), the value will be -1. TRUE/FALSE | TRUE |
| In C++, you can use the ___ function to compare a portion of a string variable's contents with another string. | compare() |
| What is the syntax for the compare() function? | string1.compare(subscript, count, string2) |
| In a compare() function, if the character you are searching for comes after the character you are comparing, a ___ will be displayed. | 1 |
| In a comapre() function, if the character you are searching for comes before the character you are comparing, a ___ will be displayed. | -1 |
| In a comapre() function, if the character you are searching for is equal to the character you are comparing, a ___ will be displayed. | 0 |
| In C++, you can use the __ function to duplicate one character a specified number of times and assign the resulting string to a string variable. | assign() |
| What is the syntax for the assign() function? | string.assign(count, character) |
| Connecting(or linking) strings together is called ___. In C++, you do this by using the ___ ___. | concatenating, concatenation operator. |
Created by:
darkskye