542 views
0 votes
0 votes
when constant type variables cannot be modified then why do we consider them as lvalues , why not only r-values ?

1 Answer

Best answer
1 votes
1 votes
Const type variables - examples "const int a" - are variables and they do have a memory location which makes them lvalues.

Constants- examples 2, 2.4 - are rvalues.

String literals- example "hello world" - are lvalues as they have a memory location (stored in RO data segment).
selected by

Related questions

0 votes
0 votes
1 answer
4
sh!va asked Jan 23, 2017
789 views
Which of the following can be considered as "UNIVERSAL GATE"?a. NANDb. AND, NOTc. AND, ORd. OR, NOTI. a onlyII. b and d onlyIII. a, b and d onlyIV. All of these