- Displaying Basic Information
- Manipulating Variable Values with Operators
- Understanding Punctuators
- Moving Values with the Assignment Operator
- Working with Mathematical/Arithmetic Operators
- Making Comparisons with Relational Operators
- Understanding Logical Bitwise Operators
- Understanding the Type Operators
- Using the sizeof Operator
- Shortcutting with the Conditional Operator
- Understanding Operator Precedence
- Converting Data Types
- Understanding Operator Promotion
- Bonus Material: For Those Brave Enough
- Summary
- Q&A
- Workshop
Understanding Operator Promotion
Implicit conversions are also associated with operator promotion, which is the automatic conversion of an operator from one type to another. When you do basic arithmetic operations on two variables, they are converted to the same type before doing the math. For example, if you add a byte variable to an int variable, the byte variable is promoted to an integer before it is added.
A numeric variable smaller than an int is promoted to an int. The order of promotion after an int is as follows:
NOTE
The following section contains advanced material that is not critical to know at this time. You can cover this material now, or you can to skip to the end of today's lesson and come back to this material later.