所以我正在尝试编写一个递归函数来跟踪它被调用的频率。由于它的递归性质,我将无法在其中定义迭代器(或者也许可以通过指针来定义它?),因为每当函数被调用时它都会被重新定义。所以我想我可以使用函数本身的参数:intcountRecursive(intcancelCondition,intcounter=0){if(cancelCondition>0){returncountRecursive(--cancelCondition,++counter);}else{returncounter;}}现在我面临的问题是,函数的调用者可以写入counter,我想避免这种情况。话又说回来,将counte