Something like this (yes, this doesn\'t deal with some edge cases - that\'s not the point):
int CountDigits(int num) { int count = 1;
I typically don't modify function parameters, unless they're pointers, in which case I might alter the value that's pointed to.