previous | start | next

Call by Constant Reference

Call by constant reference isn't really a different argument passing method.

It is just call by reference

It combines the const qualifier with the parameter type declaration and has the usual meaning.

A parameter that is declared to have values passed by constant reference

Syntax Example

Call by constant reference:

     int findMax(const int& a, const int& b, const int& c);

We could instead declare findMax to use call by value:

     int findMax(int a, int b, int c);

What is the difference between call by value and call by constant reference?



previous | start | next