Multiple inputs on one line
Yes, you can input multiple items from cin, using exactly the syntax you describe. The result is essentially identical to: This is due to a technique called “operator chaining”. Each call to operator>>(istream&, T) (where T is some arbitrary type) returns a reference to its first argument. So cin >> a returns cin, which can … Read more