Resetting static variables

Hi,
I am using static variables within a function and they are working really nicely, however I need to set it back to what it was originally in in another function, or from loop(). Is there a way to do such a thing, or is it going to have to be yet another global variable?
Thanks

You would have to call the function to reset it, as a static variable is only in the scope of the function it is declared in.

You are far better having it global if you want to modify it from other funtions.

There is another possibility, but i wouldn't recommend it:

void someFunction(boolean reset = false);
void someFunction(boolean reset){
  static byte someStatic = 0;
  if (reset){
    someStatic = 0;
    return;
  }
  
  //Rest of the function
  
}

void loop(){
  someFunction(); //Call it normally when you want to use it.
  if (youWantToResetIt){
    someFunction(true); //Reset the static.
  }
}
void func (int your_arguments, unsigned char clear) {
static unsigned int my_var= 0; 

if (clear) { my_var= 0; } //
//your code
}