Sololearn: Learn to Code
+ 2
Not sure what exampleFunc returns but I'm gonna assume it returns a reference in which case exampleFunc() = 6; is just shorthand for: int& ref = exampleFunc(); ref = 6; No need to explicitly create a variable called ref just to store 6 in it. This only works if exampleFunc returns an lvalue, like references ( int& ). It does not work with rvalues, like int, float, char.
5th Feb 2019, 7:27 PM
Dennis - avatar