...

/

Input and Output Functions

Input and Output Functions

Apart from 'cin' and 'cout', there are many other functions we can use to perform input/output operations.

Input

You can read in C++ in two way from the input stream: Formatted with the extractor >> and unformatted with explicit methods.

Formatted Input

The extraction operator >>

  • is predefined for all built-in types and strings,
  • can be implemented for user-defined data types,
  • can be configured by format specifiers.

🔑 std::cin ignores by default leading whitespace

#include
...