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

关于 cout的坑 #2

Open
SanBuks opened this issue Feb 21, 2021 · 1 comment
Open

关于 cout的坑 #2

SanBuks opened this issue Feb 21, 2021 · 1 comment

Comments

@SanBuks
Copy link

SanBuks commented Feb 21, 2021

cout自右向左计算, 自左向右输出 不准确

cout<<fun1()<<"  "<<fun2()<<endl;
// c++规定 fun1() 和 fun2()的求值顺序在同一表达式中未定义, 具体根据编译器实现
@hengqiali
Copy link
Owner

cout自右向左计算, 自左向右输出 不准确

cout<<fun1()<<"  "<<fun2()<<endl;
// c++规定 fun1() 和 fun2()的求值顺序在同一表达式中未定义, 具体根据编译器实现

我查阅了相关资料,确实如此!感谢同学指出!后续出的资料一定会更加严谨!

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