C++ · December 26, 2021 0

Initial Value

Initial value for variables is very important in C++. If a variable is in the wrong scope, errors can appear, or it won’t give the expected outcome. For example, if a variable is declared in a for loop, and it is used in a function, the announced variable will not work. But if the variable is declared in the main function and used in that function, there won’t be a value scope error.