Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++重载运算符>>和<< | singheart's blog #1

Open
xinjiempolde opened this issue Apr 5, 2022 · 1 comment
Open

C++重载运算符>>和<< | singheart's blog #1

xinjiempolde opened this issue Apr 5, 2022 · 1 comment

Comments

@xinjiempolde
Copy link
Owner

http://singhe.art/2022/04/04/C++%E9%87%8D%E8%BD%BD%E8%BF%90%E7%AE%97%E7%AC%A6/#more

概述要重载一个运算符,有两种方式: 作为成员方法,只需要一个参数。 作为全局函数,需要两个参数。 而cin和cout这两个对象我们无法对其内部成员进行修改,因此对cin和cout的重载只能使用第二种办法。

@xinjiempolde
Copy link
Owner Author

感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant