Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:introductiontoembeddedprogramming2:cppfundamentals:program_structures [2023/11/17 16:45] pczekalskien:iot-open:introductiontoembeddedprogramming2:cppfundamentals:program_structures [2023/11/23 10:20] (current) pczekalski
Line 1: Line 1:
 ====== Program Control Statements, Logical operators ====== ====== Program Control Statements, Logical operators ======
 +{{:en:iot-open:czapka_b.png?50| General audience classification icon }}{{:en:iot-open:czapka_e.png?50| General audience classification icon }}\\
 It is essential to understand that if no statements change the normal program flow, the microcontroller executes instructions one by one in the order they appear in the source code (from the top - to the down direction). Control statements modify normal program flow by skipping or repeating parts of the code. Often, to decide if the part of the code should be executed or to choose one of the number of possible execution paths, conditional statements are used. For repeating the part of the code, loop statements can be used. It is essential to understand that if no statements change the normal program flow, the microcontroller executes instructions one by one in the order they appear in the source code (from the top - to the down direction). Control statements modify normal program flow by skipping or repeating parts of the code. Often, to decide if the part of the code should be executed or to choose one of the number of possible execution paths, conditional statements are used. For repeating the part of the code, loop statements can be used.
  
-=== Conditional Statement ===+==== Conditional Statement ====
 //**if**// is a statement that checks the condition and executes the following statement if the condition is //TRUE//. There are multiple ways to write down the //**if**// statement: //**if**// is a statement that checks the condition and executes the following statement if the condition is //TRUE//. There are multiple ways to write down the //**if**// statement:
  
Line 58: Line 58:
 </code> </code>
  
-==== Logical Operators ===+==== Logical Operators ====
 To allow checking different conditions, logical operators are widely used with the condition statement //**if**// described above. To allow checking different conditions, logical operators are widely used with the condition statement //**if**// described above.
  
Line 127: Line 127:
 </code> </code>
  
-=== Switch Case Statement ===+==== Switch Case Statement ====
 A switch statement similar to the //if// statement controls the flow of a program. The code inside //switch// is executed in various conditions. A //switch// statement compares the values of a variable to the specified values in the //case// statements. Allowed data types of the variable are //int// and //char//. The //break// keyword exits the //switch// statement. A switch statement similar to the //if// statement controls the flow of a program. The code inside //switch// is executed in various conditions. A //switch// statement compares the values of a variable to the specified values in the //case// statements. Allowed data types of the variable are //int// and //char//. The //break// keyword exits the //switch// statement.
  
en/iot-open/introductiontoembeddedprogramming2/cppfundamentals/program_structures.1700239520.txt.gz · Last modified: 2023/11/17 16:45 by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0