[solved]Easy Question About Passed Variables And Scope

if i am declaring functions like this:

void homeScreen();
void zoneAdjust(byte Zone);
void inputTracking();
void dimAdjust(byte zone);
void setDimvalue(byte Qzone);

do i have to change the pass variable name? or could they all be like this?

void homeScreen();
void zoneAdjust(zone);
void inputTracking();
void dimAdjust(zone);
void setDimvalue(zone);

void homeScreen();
void zoneAdjust(byte Zone);
void inputTracking();
void dimAdjust(byte zone);
void setDimvalue(byte Qzone);

void setup(){
}

void loop(){
byte x = 3;
byte x = 4;

homeScreen();
zoneAdjust(x);
inputTracking();
dimAdjust(x);
setDimvalue(y);
}

I have tested it myself and it doesnt appear to make a difference, but i know from experience (not putting break after every switch/case statement) just because it works one time, doesnt mean it will work the next timeā€¦

Thanks!

You have to declare their type but they can be named the same. They only have scope or meaning within that particular function.

They can all be named the same. The function arguments act like local variables: if it has the same name as a global variable you won't be able to use the global variable inside the function.

One common naming convention is to use an initial capital on global variables and initial lowercase on local variables. Makes them easier to keep track of.

thanks!

If you don't specify a type, I believe it defaults to "int".