Question: 4.6 Note: L-VALUE represents an object that occupies some identifiable location in memory, its address. It is sometimes called a LOCATOR VALUE. R-values need to

4.6 Note: L-VALUE represents an object that occupies some identifiable location in memory, its address. It is sometimes called a LOCATOR VALUE. R-values need to be resolved to a value. C++ defines an r-value as everything that is not an l-value. (defined by exclusion). Using this definition, an r-value is a representation something occupying some identifiable location in memory. C permits l-values to appear in four contexts:

1) left of assignment (except for arrays names, const lvalues (e.g. constant pointer), and struct/union lvalues with at least one const member);

2) left of dot (struct/unions);

3) right of address-of (except for register and bit field lvalues), or

4) as operand to pre/post increment/decrement (for integer lvalues, including enums).

For the language C,

a) give three examples of righthand-values (r-values) that cannot be left-hand values (l-values).

b) Give three additional examples of l-values?

c) Are there l-values that cannot be r-values? Explain why or why not.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!