What is the scope of a literal value, and how does the compiler allocate memory to it?
问题 int x = 12; 12 is said to be integer literal, and therefore can't be used in the LValue. How does the compiler allocate memory to a literals? What is the scope of a literals? Why can't we get its address with an &12 in its scope? 回答1: OK Bad example in the question. But the question is still valid: Lets try: Foo getFoo() {return Foo();} int func() { getFoo().bar(); // Creates temporary. // before this comment it is also destroyed. // But it lives for the whole expression above // So you can