Skip to content

Commit bd59658

Browse files
authored
Merge pull request #673 from animeshsrivastava24/patch-20
Code Highlight markup and Link colouration fix scope.adoc
2 parents c2c6ee3 + 8b6a8e6 commit bd59658

File tree

1 file changed

+2
-2
lines changed
  • Language/Variables/Variable Scope & Qualifiers

1 file changed

+2
-2
lines changed

Language/Variables/Variable Scope & Qualifiers/scope.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ subCategories: [ "Variable Scope & Qualifiers" ]
1919
=== Description
2020
Variables in the C++ programming language, which Arduino uses, have a property called scope. This is in contrast to early versions of languages such as BASIC where every variable is a _global_ variable.
2121

22-
A global variable is one that can be seen by every function in a program. Local variables are only visible to the function in which they are declared. In the Arduino environment, any variable declared outside of a function (e.g. setup(), loop(), etc. ), is a _global_ variable.
22+
A global variable is one that can be seen by every function in a program. Local variables are only visible to the function in which they are declared. In the Arduino environment, any variable declared outside of a function (e.g. `link:../../../structure/sketch/setup[setup()]`, `link:../../../structure/sketch/loop[loop()]`, etc. ), is a _global_ variable.
2323

2424
When programs start to get larger and more complex, local variables are a useful way to insure that only one function has access to its own variables. This prevents programming errors when one function inadvertently modifies variables used by another function.
2525

26-
It is also sometimes handy to declare and initialize a variable inside a `for` loop. This creates a variable that can only be accessed from inside the for-loop brackets.
26+
It is also sometimes handy to declare and initialize a variable inside a `link:../../../structure/control-structure/for[for]` loop. This creates a variable that can only be accessed from inside the link:../../../structure/control-structure/for[`for`]-loop brackets.
2727
[%hardbreaks]
2828

2929
--

0 commit comments

Comments
 (0)