Something like this (yes, this doesn\'t deal with some edge cases - that\'s not the point):
int CountDigits(int num) { int count = 1;
The code needs to be as self sufficient as possible. What I mean by that is you now have a dependency on what is being passed in as part of your algorithm. If another member of your team decides to change this to a pass by reference then you might have big problems.
The best practice is definitely to copy the inbound parameters if you expect them to be immutable.