If I have a function that increments a *global* variable according to some rule and I pass a variable by reference, do I have to do a return or will the variable be updated anyway? Would this also work with a local variable? For example:

```
static uint8_t counter = 1;

void add(uint8_t *variable)
{
   if (*variable == 5)
   {
    *variable = 7;

   } else if (*variable == 20)
   {
    *variable = 1;
   } else
   {
    *variable++;
   }
}

```

And I call the 'add' function somewhere like:

```
void function(void)
{
... some code...
add(&counter);
... some code...
}

```