I was wondering how to make a function consider a given parameter as a static variable. For example, i tried, without success, to generate hailstone numbers:

```
#include<stdio.h>
int hailstone(int);
int n;                            /* n is an extern variable*/

int main(){
    hailstone(n);
    return 0;
}

int hailstone(int n){
    static int m = n;            /*not possible because n is not constant*/
    if(m % 2 == 0 && m != 1)
        hailstone(m /= 2);
    else if(m != 1)
        hailstone((m *= 3) + 1);
    else
        exit(0);                 /*Is the use of exit() correct, in this case?*/
    return 0;
 }

```

I would like to use a static variable to elaborate n. Otherwise, each recursive call would operate on the whole parameter `n`, thus going on endless, never reaching the case base.

Few questions:

1. Does this idea represent a feasible approach to the problem?
2. Does this idea represent a *reasonable/effective* approach to the problem?
3. Is `exit(0)` used correctly, in a similar case?