Ternary Operator can also be used in Lvalue in C++ programming language
Operators in CPP
As we all known and used ternary operator (Conditional operator)(?:) in the rvalue of the assignment statement, which assign the true statement value to the lvalue or else false statement value if condition fails.
But similarly, we can also use the same functionality in the lvalue side of the assignment operator too. Based on the condition, the ternary operator determines which lvalue variable should hold the value.
This concept can be used if our program needs a decision to be taken which variable to hold the resultant value.
Checkout my sample code to explain this concept
Conclusion
Thanks for reading, hope this blog helps.