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

2.2章节-输入输出流操作符重载问题 #302

Closed
zceeyh0 opened this issue Jun 24, 2023 · 2 comments
Closed

2.2章节-输入输出流操作符重载问题 #302

zceeyh0 opened this issue Jun 24, 2023 · 2 comments

Comments

@zceeyh0
Copy link

zceeyh0 commented Jun 24, 2023

practical_exercises/key_exercises/io_operator_overload.cpp
A48J~CMBXC340(K_9NVGD S
此处输入输出运算符重载的返回类型为Sale&,是否应该改为ostream&和istream&?
如果不返回流对象,类似cout << sale1 << sale2 << endl; 这种嵌套调用就会报错了。

@laialaodi
Copy link
Contributor

如果你要用 cout << sale1 << sale2 << endl; 这种嵌套写法那当然得改

@zceeyh0
Copy link
Author

zceeyh0 commented Jun 29, 2023

嗯,我就是想表达这个意思

@zceeyh0 zceeyh0 closed this as completed Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants