< previous page page_85 next page >

Page 85
Hour 6
Basic Classes.
Classes extend the built-in capabilities of C++ to assist you in representing and solving complex, real-world problems. In this hour you will learn
What classes and objects are
How to define a new class and create objects of that class
Creating New Types
You've already learned about a number of variable types, including integers and characters. The type of a variable tells you quite a bit about it. For example, if you declare Height and Width to be unsigned short integers, you know that each one can hold a number between 0 and 65,535 (assuming an unsigned short integer is 2 bytes).
In fact, that is what is meant by an unsigned short integer. Holding these numbers is not just a byproduct of being an unsigned short integer; it is the definition of an unsigned short integer.
In addition to telling you the size, the type tells you the capabilities of the object. For example, short integers can be added together. Thus, just by

 
< previous page page_85 next page >

If you like this book, buy it!