Why are bitwise shifts (<< and>>) used for cout and cin?

后端 未结 13 1678
眼角桃花
眼角桃花 2020-12-02 16:16

Question is in the title really; I\'m sure there is something logical, but for now I\'m stumped!

13条回答
  •  -上瘾入骨i
    2020-12-02 17:00

    So you remember that if you think cin as a keyboard and cout as a monitor, what you type goes into the variable

    cin>>var;
    

    Or the contents of your variable goes towards the screen

    cout<

提交回复
热议问题