Tutorial by Examples

The scope of a variable in a block { ... }, begins after declaration and ends at the end of the block. If there is nested block, the inner block can hide the scope of a variable which is declared in the outer block. { int x = 100; // ^ // Scope of `x` begins here // } // ...
To declare a single instance of a variable which is accessible in different source files, it is possible to make it in the global scope with keyword extern. This keyword says the compiler that somewhere in the code there is a definition for this variable, so it can be used everywhere and all write/r...

Page 1 of 1