Example

int function(int &a, int &b){
a++;   
return b;
}

Solution
Use the const keyword whenever possible so that the compiler enforces that variables are not modified.

int function(int &a, const int &b){
a++;   
return b;
}