static byte usage across functions

Reading this static byte reference is it correct to assume that when declaring a variable

static byte example;

in one function this exact same variable can be declared in another function without interfering with one another?

Yes. But it has nothing to do with it being static. Static means that it will retain its value after the function exits and gets called again.

Unless any of this is in a class in which case static means something else. You weren't real clear there.

Google "C++ variable scope" for more information.

Delta_G:
Yes. But it has nothing to do with it being static. Static means that it will retain its value after the function exits and gets called again.

Unless any of this is in a class in which case static means something else. You weren't real clear there.

Google "C++ variable scope" for more information.

Thanks (and for the Google ref too)!

brice3010:
Reading this static byte reference is it correct to assume that when declaring a variable

static byte example;

in one function this exact same variable can be declared in another function without interfering with one another?

If you declare a variable with the same name as an existing variable then it will not be the "exact same variable", it will be a different variable with the same name, but why confuse things by using a different variable with the same name ?

The real fun starts when you declare a local variable with the same name as a global variable. Which variable is being accessed when you read or write the variable, the local one or the global one ?

Avoid any problems and use local variables with unique names that indicate their purpose, except perhaps for those with a very limited scope such as for loops where you can be sure that their value will not be needed outside of the for loop.

Of corse,
If you deckare a local variable, of every type and attributes, you "cover" any other variables witch the same name. I don't understand the reason to do it, specially witch constant variables. I use const variables to store information that I don't want modify, ehy modify the variable?