Top "Lvalue" questions

L-value represents the address of the value.

Are literal strings and function return values lvalues or rvalues?

Just wonder if a literal string is an lvalue or an rvalue. Are other literals (like int, float, char etc) …

c lvalue rvalue
Javascript Ternary Operator lvalue

I was reading about the ternary operator in different languages, and noticed something interesting in the Javascript section. http://en.…

javascript lvalue
Why is taking the address of a temporary illegal?

I know that the code written below is illegal void doSomething(std::string *s){} int main() { doSomething(&std::string("…

c++ temporary memory-address lvalue rvalue
Rvalue to lvalue conversion?

Why it is not possible to convert rvalues to lvalues? It is possible to do a conversion in the opposite …

c++ c++11 type-conversion rvalue-reference lvalue
Why doesn't a+++++b work?

int main () { int a = 5,b = 2; printf("%d",a+++++b); return 0; } This code gives the following error: error: lvalue required as …

c lvalue
C++: is return value a L-value?

Consider this code: struct foo { int a; }; foo q() { foo f; f.a =4; return f;} int main() { foo i; i.…

c++ return-value lvalue
Function that accepts both lvalue and rvalue arguments

Is there a way to write a function in C++ that accepts both lvalue and rvalue arguments, without making it …

c++ function c++11 lvalue rvalue
lvalue required as increment operand error

#include <stdio.h> int main() { int i = 10; printf("%d\n", ++(-i)); // <-- Error Here } What is wrong …

c++ c operators lvalue rvalue
Passing rvalue reference to const lvalue reference paremeter

I am trying to understand C++11 rvalue references and how to use them for optimal performance in my code. Let's …

c++ c++11 lvalue rvalue const-reference
PODs, non-PODs, rvalue and lvalues

Could anyone explain the details in terms of rvalues, lvalues, PODs, and non-PODs the reason why the first expression marked …

c++ rvalue lvalue