C++ examples for Function:Function Parameter
Demonstrate constant function arguments
void aFunc(int& a, const int& b); //declaration int main()// w w w . j a va 2 s.co m { int alpha = 7; int beta = 11; aFunc(alpha, beta); return 0; } void aFunc(int& a, const int& b) //definition { a = 107; //OK //b = 111; //error: can't modify constant argument }