Difference of function argument as (const int &) and (int & a) in C++
- by Narek
I know that if you write void function_name(int& a), then function will not do local copy of your variable passed as argument. Also have met in literature that you should write void function_name(const int & a) in order to say compiler, that I dont want the variable passed as argument to be copied.
So my question: what is the difference with this two cases (except that "const" enshures that the variable passes will not be changed by function!!!)???