CIS 2500 Chapter Notes - Chapter 2: Operand, In C
Document Summary
Chapter 2. 4 & 2. 5 & 2. 6 & 2. 7. All variables must be declared before use, although some declarations can be made by content. A declaration states the type, and contains one or more variables of said type. (ie. int lower, upper, step;) A variable can be initialized in its declaration (ie. float eps = 1. 0 e-5;) Initialization of a variable is done only once, so long as the variable is not automatic, before the program executes. An automatic variable is initialized each time the function or block it is in is entered. External and static variables are set to 0 by default. Automatic variables with no initializer are undefined (ie. garbage) values. The qualified const can be applied to the declaration of any variable to specify that the value of the variable will remain the same. For an array, const means that the elements will not change. Binary arithmetic operators are +, -, *, /, and %