COP-3014 Lecture Notes - Lecture 1: Type Conversion, Escape Character, Switch Statement
Document Summary
For, while, etc. : valid examples i. ii. int _count; int count_count; c. Invalid examples i. ii. int 4notok; int also*not#ok; Int i,j,k=1 i: double r,s,t=3. 14, const int uno=1; Assigning data: syntax, variable = expression, examples i = 10; i, counter = i*34; iii. j = (k = 3); Iv: note: k is assigned the value of 3, and then assigns to j the value in k. Data assignment rules a. intvar=2. 99 2 is assigned because only integer part its : called implicit or automaic type conversion, literals, considered constants : can"t change in program, examples, x=2, y=5. 75, cannot change values during execuion. Escape sequences: backslash, \ preceding a character, cues that a special escape character is coming. Constants: constants are useful by giving meaningful names to values, const int arraysize=100, const double pi=3. 14; Arithmeic operator precedence: everything inside a parenthesis is evaluated irst.