Global Variables in C++

Subscribers:
50,600
Published on ● Video Link: https://www.youtube.com/watch?v=C0Keab4nfa0



Duration: 0:00
244 views
15


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:    • C++ Functions  
Pass by Value vs Reference:    • C++ Functions Pass by Value or Reference  
Const Reference:    • C++ Const Reference  

C++ Playlist:
   • C++ Programming Tutorial  

Install C++ with VS Code:
   • How to set up C++ in Visual Studio Code  

Subscribe for more coding tutorials 😄!