functions

codetojoy (11)
Hi. I cannot remember under what condition, or for what purpose a function would be placed to the left of the assignment statement. It may have something to do with passing by reference, but I'm not sure. Can someone please clarify. For example:
function() = something.
Last edited on
vlad from moscow (3111)
It can be done provided that the left side expression is lvalue.:)
codetojoy (11)
please expand on that with an example!!
vlad from moscow (3111)
std::string s( 1, ' ' );

s[0] = 'A';

That it will be more clear the last statement can be rewritten as

s.operator[]( 0 ) = 'A';
Last edited on
codetojoy (11)
благодарить = thanks.
Topic archived. No new replies allowed.