what is the purpose of using 'const int &' as formal argument?

thx
const int & doesn't make much sense but const Aclass & is used in order not to copy an object of 'Aclass' which can take much longer time than passing a const reference
Addition:
const can be used by compiler to optimize you code.
Passing an int by reference and promising not to modify it is a strange operation indeed.
Topic archived. No new replies allowed.