Control variable (programming)
A control variable in computer programming is a program variable that is used to regulate the flow of control of the program.
In definite iteration, control variables are variables which are successively assigned (or bound to) values from a predetermined sequence of values.[1]
Special rules
In some programming languages control variables are just ordinary variables used for manipulating the program flow. This is the case of C, Fortran, and Pascal, which allow for control variables to have their values changed within the loop body.[1] However, some languages have special rules for control variables. In Ada, for instance, the control variable of the for loop must remain constant within the loop body.
gollark: Or he's just talking about a slightly different thing. Hopefully?
gollark: ... punishing someone who killed someone is *bad*?
gollark: I mean, I go to a decent school with competent teachers and stuff, but it's still mostly pretty boring and unpleasant.
gollark: School is at least pretty good at instilling mindless obedience!
gollark: Not *all* of it. And I think we should aim to reduce that.
References
- Watt, David A. (2004). Programming Language Design Concepts. Wiley. pp. 84-85.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.
