Electrical and Computer Engineering
1 of 12
UAH
CPE 112
Simple Data Types: Built-In
and User-Defined
•Additional C++ operators: +=, -=, *=, /=
•Statement Equivalent Statement
•i += 5; i = i + 5;
•pivotPoint *= n + 3; pivotPoint * (n + 3);
•The Cast Operation
–Two forms:
•intVar = (int) floatVar;
•intVar = int(floatVar); (only works if the data type name is a single identifier)
– myVar = (unsigned int) someFloat; (the only way for this one)