C++ Global Variables. In this video, you will learn about global and local variable scope. Scope refers to the area where a function or variable is visible and accessible to other code. There are 3 main types of scope:
- Function scope is accessible only within the function.
- Block scope, also known as local scope, is accessible only within the block or inner blocks. Examples of blocks include if/else conditions, for loops, while loops.
- File scope, also known as global scope, is accessible within the entire file. This covers all blocks.
If you need to review these topics:
Functions: https://youtu.be/65PSQUdH5k0
Pass by Value vs Reference: https://youtu.be/77XcoXwoK2c
Const Reference: https://youtu.be/aP_VwBrPrJw
C++ Playlist:
https://www.youtube.com/playlist?list=PLnKe36F30Y4ZDNIOZ51sX25pWKQ1pkpTE
Github Repo for C++ Code:
https://github.com/ImKennyYip/cpp
Install C++ with VS Code:
https://youtu.be/DMWD7wfhgNY
Subscribe for more coding tutorials !