Same as stdin, you use the >> and << operators.
https://cplusplus.com/reference/istream/istream/operator%3E%3E/