We will cover the following recipes in this chapter:
- Creating, concatenating, and transforming strings
- Trimming whitespace from the beginning and end of strings
- Getting the comfort of
std::string
without the cost of constructingstd::string
objects - Reading values from user input
- Counting all words in a file
- Formatting your output with I/O stream manipulators
- Initializing complex objects from file input
- Filling containers from
std::istream
iterators - Generic printing with
std::ostream
iterators - Redirect output to files for specific code sections
- Creating custom string classes by inheriting from
std::char_traits
- Tokenizing input with the regular expression library
- Comfortably pretty printing numbers differently per context on the fly
- Catching readable exceptions from
std::iostream
errors