C++ Chapter 4 Strings Review
Home > Preview
The flashcards below were created by user
on FreezingBlue Flashcards.
How long can a C++ string be?
as long as you need it to be
True/False: String literals appear between " " and character literals appear between ' '.
True "hello or 'h' single character
What compiler directive(s) are needed with strings?
- #include <string>
- using std::string;
What function flushes out the input stream?
What does cin.ignore(80,'\n'); do?
It will remove up to 80 characters or until it finds a '\n'.
When should we use cin.ignore(80,'\n');?
After cin >> ... for numeric input
What is (>>) called?
the extraction operator (>>)
What is (<<) called?
the insertion operator (<<)
What does the format option showpoint do?
displays decimal point and zeroes
What does the format option showpos do?
displays + before positive values
What does the format option scientific do?
floating point numbers in E notation
What does the format option fixed do?
float point numbers in ordinary notation
What compiler directive(s) is needed for setprecision and setw?
Setw is used to set the number of digits that will be displayed, also known as the...
What function is used to input strings?
- string address;
- getline(cin, address);
A class is a generic definition for a(n)...
Objects hold ____ and __________/_________.
data and operations/functions
What would you like to do?
Home > Flashcards > Print Preview