cplusplus:control_structures_selection
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cplusplus:control_structures_selection [2013/02/03 06:16] – mithat | cplusplus:control_structures_selection [2017/01/30 20:32] – mithat | ||
---|---|---|---|
Line 4: | Line 4: | ||
====== Control Structures: Selection ====== | ====== Control Structures: Selection ====== | ||
- | Mithat Konar\\ | + | Mithat Konar\\ |
- | 2013-02-03 | + | |
===== Introduction ===== | ===== Introduction ===== | ||
Line 15: | Line 14: | ||
* Three kinds of control structures are used in C++ and many other languages: | * Three kinds of control structures are used in C++ and many other languages: | ||
- | * **Sequence | + | * **Sequence** |
* Statements are executed one after the other. | * Statements are executed one after the other. | ||
* This is C++'s default behavior! | * This is C++'s default behavior! | ||
Line 27: | Line 26: | ||
===== Single-entry/ | ===== Single-entry/ | ||
- | | + | * Control structures that are entered from one point and exited from one point. |
- | | + | * Connect the exit point of one control structure to entry point of the next: **control-structure stacking**. |
- | * Connect the exit point of one control structure to entry point of the next: **control-structure stacking**. | + | * Makes programs easy to build. |
- | * Makes programs easy to build. | + | |
===== Selection structures ===== | ===== Selection structures ===== | ||
Line 223: | Line 221: | ||
|'' | |'' | ||
|'' | |'' | ||
+ | |||
+ | * [[selection_examples# | ||
===== Short-circuiting ===== | ===== Short-circuiting ===== | ||
Line 247: | Line 247: | ||
===== Comparing characters and strings ===== | ===== Comparing characters and strings ===== | ||
- | * See Gaddis 4.12. | + | |
+ | | ||
===== The conditional operator ===== | ===== The conditional operator ===== | ||
Line 259: | Line 260: | ||
===== switch structure ===== | ===== switch structure ===== | ||
- | * See Gaddis 4.14. | + | |
+ | | ||
===== More about blocks and scope ===== | ===== More about blocks and scope ===== | ||
- | * See Gaddis 4.15. | + | * See Gaddis 4.15 (programs Pr4-28.cpp to Pr4-30.cpp). |
cplusplus/control_structures_selection.txt · Last modified: 2017/01/31 23:57 by mithat