C++ STRINGS Flashcards

1
Q

contains a collection of characters surrounded by double quotes

A

STRING

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

you must include an additional header file in the source cod, the <string> library</string>

A

STRING

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

CAN ALSO be DEFINED AS CHARACTER ARRAY

A

STRING

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

The + operator can be used between strings to add them together to make a new string. This is called concatenation

A

String concatenation

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

C++ uses the + operator for both addition and concatenation. Numbers are added. Strings are concatenated

A

String concatenation

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

FORMAT: strName.length();

A

LENGTH FUNCTION

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

FORMAT: getline(cin, strName, [charDelimiter]);

A

INPUT FUNCTION

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

FORMAT: cin.ignore([noOfChar], [charDelimiter]);

A

IGNORE FUNCTION

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

FORMAT: strName.substr(index,[count]);

A

SUBSTRING FUNCTION

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

FORMAT: strName.insert(index, strToInsert);

A

INSERT FUNCTION

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

FORMAT: strName.replace(index, count, strToReplace);

A

REPLACE FUNCTION

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

FORMAT: strName.erase(index, count);

A

ERASE FUNCTION

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

FORMAT: strName.find(strToFind, [index]);

A

FIND FUNCTION

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

FORMAT: strName.assign(count, charToAssign);

A

ASSIGN FUNCTION

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

– getch();
- A PRE-DEFINED FUNCTION IN “CONIO.H”
- READS A SINGLE CHARACTER FROM THE KEYBOARD AND IT DOESN’T ECHO TO THE CONSOLE AND DOESN’T WAIT FOR AN ENTER TO STORE IN A VARIABLE.

A

GET CHARACTER FUNCTIONS

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