3 ms·
In C, n=f(x) plainly means the variable n is assigned the value returned from f(x). While you don't know what f(x) does, you can tell it is a function. In c++
by qdog 5y ago
In C, n=f(x) plainly means the variable n is assigned the value returned from f(x). While you don't know what f(x) does, you can tell it is a function.
In c++, the = could be a function too, that does unexpected things. Critically, if you are unaware of the side effects of that = operator, you may be doing things you don't want to do. The most likely issue would be performance if you are repeatedly using the = operator thinking it is a simple operation. Like if someone is being clever and uses the Active Record model and you are unexpectedly doing database writes with what you thought was a local object with no side effects.
To not have this happen, of course, you could read the entire object definition, but then you need everyone working on the project to have 100% of the code committed to memory. This is why you will likely find rules in the coding style guide of whatever company banning such practice after someone is bitten by it.