EXAM Flashcards
How many primitive types does C have?
14
How many primitive data types does C++ have?
18
How many char data types does C++ have?
5
char, unsigned char, wchar_t, char16_t, char32_t
What data type did C++ add that C didn’t have?
Boolean
How many bytes is a wchar_t?
2 or 4
What does the sizeof operator return?
The size of a data type in bytes
What header is needed to find the min and max of data types?
include < limits >
What is the new syntax for casting a data type?
int val = static_cast< data_type >(number);
What is a constexpr
An expression that can be evaluated at compile time.
What is the new syntax for specifying a type alias?
using wages = double;
What two keywords can be used for type aliases?
typedef OR using
What is std
The C++ standard library namespace
What does using a namespace help avoid?
Name collision from multiple programs using the same identifiers
What header is needed for IO operations from the console?
< iostream >
What header is needed for IO operations for files?
< fstream >
What header is needed for IO operations with a string?
< sstream >
What are the input/ouput objects for a string?
istringstream, ostringstream
What is “ < < “
The Insertion Operator
What does endl do?
Adds a newline and flushes the stream
How do you set precision with stream manipulators?
setprecision(2)
How do you set the width using a stream manipulator?
setw(9)
What are the objects/functions included in < iomanip >
setfill(ch) setprecision(n) setw(w) setbase(b) put_money(int) put_time()
What is held in < locale > header?
Geographic location features for formatting
What argument is passed to a locale object to specify current locale?
locale loc(“”);
What does the extraction operator do with whitespace?
It ignores leading whitespace
What is “»” called?
The extraction operator
What does getline() do?
Reads characters from a stream up to and excluding the delimiter