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

课后习题13.46 不知道我这样理解是否是对的。 #86

Open
EnzoFerrari430 opened this issue Nov 5, 2018 · 0 comments
Open

Comments

@EnzoFerrari430
Copy link

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。
哪里想的有错,请帮忙指出来,谢谢。

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

1 participant