CSCI 103L Lecture Notes - Lecture 5: Compile Time, Null Character

41 views2 pages

Document Summary

The loops that keep on giving: bad to get stuck in an in nite loop. Control + c force quits out of an in nite loop. Single statement loops and if statements don"t need { }"s, but it"s good practice to always use them: nested loops. Inner loops execute fully inside the body of the outer loop. Nested loops are useful for tables, row and column: break and continue. Break: end the current loop immediately and continue execution after its last statement. Ex: if (tries > 100) { break; } Continue: begins the next iteration of the nearest loop: Ex: if guess is wrong continue; (start the loop over again) Break is used more commonly continue not as much: preprocessor and directives. Compiler will scan through c code looking for directives: ex: #include #de ne, anything that starts with , inserts text from an outside le, #include < lename> or #include lename, #de ne nd_pattern replace_pattern.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers