Assigning to functions? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Assigning to functions?

https://code.sololearn.com/cVJ322bN3ncC/?ref=app What is happening when we assign to f()?

5th Jun 2018, 8:30 AM
Max
Max - avatar
1 Answer
+ 2
never mind, i figured it out, f() returns a lvalue reference to i, and therefore we assign to i, since lvalue referenced are lvalues and since the variable is static everything works out. https://stackoverflow.com/questions/6111905/c-is-return-value-a-l-value
5th Jun 2018, 8:45 AM
Max
Max - avatar