Programming in c++ Simple Data Types: Built-in and Use- Defined Dale/eems/Headington
1 Simple Data Types: Built-in and Use-Defined
Programming in C++ Chapter 10 Topics Built-In Simple Types Integral and Floating Point Data Types Using Combined Assignment Operators Prefix and Postfix Forms of Increment and Decrement Operators Additional C++ Operator Character Sets s Using an Enumeration Type Creating and Including User-Written Header Files
2 Chapter 10 Topics ❖ Built-In Simple Types ❖ Integral and Floating Point Data Types ❖ Using Combined Assignment Operators ❖ Prefix and Postfix Forms of Increment and Decrement Operators ❖ Additional C++ Operator ❖ Character Sets ❖ Using an Enumeration Type ❖ Creating and Including User-Written Header Files
Programming in C++ Built-In Simple Types o Simple(atomic)data type A data type in which each value is atomic(indivisible) 心 Example: a single character of type char is atomic, but the string Good Morning is not
3 Built-In Simple Types ❖Simple(atomic)data type: A data type in which each value is atomic(indivisible). ❖Example: a single character of type char is atomic, but the string “Good Morning” is not
Programming in C++ C++ Simple Data Types simple types ntegral floating char short int long bool enum float double long double unsigned
4 C++ Simple Data Types simple types integral floating char short int long bool enum float double long double unsigned
Programming in C++ By definition the size of a C++ char value is always 1 byte exactly one byte of memory space Sizes of other data type values in C++ are machine-dependent
5 By definition, the size of a C++ char value is always 1 byte. exactly one byte of memory space Sizes of other data type values in C++ are machine-dependent. ‘A’