Initial value

from Wikipedia, the free encyclopedia

In computer science, the initial value is the first assigned value (initial value) of a variable after its declaration (definition).

For example, a counter variable is defined in the programming of loops and its initial value is set to the number of required loop runs; the program then receives the orders to reduce this value by the value "one" with each loop pass and not to pass through the loop if this variable value is "zero".

An initial value can be used to ensure that meaningful values ​​are assigned to a variable when it is created. Some compilers initialize local variables without the need for a specification in the program code.