i have a few questions on variable scope and the differences between arduino and c++.
first any variable declared outside of all functions is a global variable. i totally get that.
a variable declared inside a function is a local variable that can only be accessed by that function. this is where it gets fussy.
for example
void loop()
{ int bob; // this declares an integer bob
int steve = 5; // this declares the integer steve and sets it to five}
if i were to run this code the declaration of bob as void loop repeats would not affect the value of bob after a value is stored.
but would steve be redeclared with the value 5 every time void loop repeats?
if it does always reset to 5 how can variables get an initial value inside a local scope without declaring them globally?