Using function arguments as local variables

前端 未结 9 1304
野的像风
野的像风 2020-12-30 03:57

Something like this (yes, this doesn\'t deal with some edge cases - that\'s not the point):

int CountDigits(int num) {
    int count = 1;
             


        
9条回答
  •  伪装坚强ぢ
    2020-12-30 04:14

    I typically don't modify function parameters, unless they're pointers, in which case I might alter the value that's pointed to.

提交回复
热议问题