We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
r1是右值 因为f() return int是一个临时变量。临时变量是右值
r2是左值 因为vi[0]是一个变量,变量表达式是左值,或者说vi[0]是一个持久的状态,所以它是左值。我这里不清楚这2点是不是都是对的。
r3是左值 因为r1是一个变量,变量表达式是左值。
r4是右值 因为vi[0]是一个持久的变量,f()是一个临时的变量。vi[0] * f() 就变成了一个字面值常量。因为它没有了自增自减的操作。
我不知道我这些想法是不是都对的。我看着上面的答案也没有解释https://github.com/Mooophy/Cpp-Primer/tree/master/ch13。 哪里想的有错,请帮忙指出来,谢谢。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
r1是右值 因为f() return int是一个临时变量。临时变量是右值
r2是左值 因为vi[0]是一个变量,变量表达式是左值,或者说vi[0]是一个持久的状态,所以它是左值。我这里不清楚这2点是不是都是对的。
r3是左值 因为r1是一个变量,变量表达式是左值。
r4是右值 因为vi[0]是一个持久的变量,f()是一个临时的变量。vi[0] * f() 就变成了一个字面值常量。因为它没有了自增自减的操作。
我不知道我这些想法是不是都对的。我看着上面的答案也没有解释https://github.com/Mooophy/Cpp-Primer/tree/master/ch13。
哪里想的有错,请帮忙指出来,谢谢。
The text was updated successfully, but these errors were encountered: