Tutorial by Examples

std::boolalpha and std::noboolalpha - switch between textual and numeric representation of booleans. std::cout << std::boolalpha << 1; // Output: true std::cout << std::noboolalpha << false; // Output: 0 bool boolValue; std::cin >> std::boolalpha >> bool...
std::ends - inserts a null character '\0' to output stream. More formally this manipulator's declaration looks like template <class charT, class traits> std::basic_ostream<charT, traits>& ends(std::basic_ostream<charT, traits>& os); and this manipulator places charact...
std::ws - consumes leading whitespaces in input stream. It different from std::skipws. #include <sstream> ... std::string str; std::istringstream(" \v\n\r\t Wow!There is no whitespaces!") >> std::ws >> str; std::cout << str; // Output: Wow!There is n...

Page 1 of 1