I am trying to work on a program that has a function whose parameter is an vector of string. I want to use recursive on that function but everytime the function is called, I want to change the parameter to say for example 

```
fun(stringArray[i]) 

```

where i is the number of time the function has been called. 

So in simpler way something like following. But I need to keep track of how many times the function fun has been executed. 

```
void fun(){
    cout<<hi;
    if(x!=10)
    fun()
}

int main(){

    fun();
}

```

In this one let's say I want to print it out just 10 times, so want to have a varible that increments, and when reaches 10, it stops. So in general what can I do to keep track of it? I tried using global variables but they don't seem to work with functions. Any suggestions?