C Programming :: Basic Concepts - Discussion
37 / 90
Assignment operator targets to _____
Ar-value
Bl-value
Cboth
DNone
Show Explanation
For example-
a=5; //assigns '5' to 'a'.
On the other hand, 5=a; //error.
Very often in C, we use the terminology of l-value in error messages. It basically refers to the operands present on the left-hand side of the assignment operator. It can be a variable or a pointer, but should not be a constant.
Hence, from the above theory, we can conclude for sure that assignment operator targets to L-value.
Asked In ::
Assignment operators are used to assign the the values present on the right-hand side to whatever is present on the left-hand side of the operator. The left-hand side can be a variable or a pointer, and the right-hand side can be a variable, a constant, an expression or a function call.
For example-
a=5; //assigns '5' to 'a'.
On the other hand, 5=a; //error.
Very often in C, we use the terminology of l-value in error messages. It basically refers to the operands present on the left-hand side of the assignment operator. It can be a variable or a pointer, but should not be a constant.
Hence, from the above theory, we can conclude for sure that assignment operator targets to L-value.
Read Full Answer
Report Error
Please Login First Click Here