|
||||||||
Here is a brief description of the chapters contained in this ebook:((0)) The evolluttiion off objjecttss.. When projects became too big and too complicated to easily maintain, the “software crisis” was born, saying, “We can’t get projects done, and if we can they’re too expensive!” This precipitated a number of responses, which are discussed in this chapter along with the ideas of object-oriented programming (OOP) and how it attempts to solve the software crisis. You’ll also learn about the benefits and concerns of adopting the language and suggestions for moving into the world of C++. ((1)) Datta abssttracttiion.. Most features in C++ revolve around this key concept: the ability to create new data types. Not only does this provide superior code organization, but it lays the ground for more powerful OOP abilities. ((2)) Hiidiing tthe iimpllementtattiion.. You can decide that some of the data and functions in your structure are unavailable to the user of the new type by making them priivatte. This means you can separate the underlying implementation from the interface that the client programmer sees, and thus allow that implementation to be easily changed without affecting client code. ((3)) IIniittiialliizattiion & clleanup.. One of the most common C errors results from uninitialized variables. The constructor in C++ allows you to guarantee that variables of your new data type will always be properly initialized. If your objects also require some sort of cleanup, you can guarantee that this cleanup will always happen with the C++ destructor. ((4)) Functtiion overlloadiing & deffaulltt argumenttss.. C++ is intended to help you build big, complex projects. While doing this, you may bring in multiple libraries that use the same function name, and you may also choose to use the same name with different meanings within a single library. ((5)) IInttroducttiion tto iiossttreamss.. One of the original C++ libraries – the one that provides the essential I/O facility – is called iostreams. Iostreams is intended to replace C’s ssttdiio..h with an I/O library that is easier to use, more flexible, and extensible – you can adapt it to work with your new classes. ((6)) Conssttanttss.. This chapter covers the consstt and vollattiille keywords that have additional meaning in C++, especially inside classes. It also shows how the meaning of consstt varies inside and outside classes and how to create compile-time constants in classes. ((7)) IInlliine ffuncttiionss.. Preprocessor macros eliminate function call overhead, but the preprocessor also eliminates valuable C++ type checking. The inline function gives you all the benefits of a preprocessor macro plus all the benefits of a real function call. ((8)) Name conttroll.. Creating names is a fundamental activity in programming, and when a project gets large, the number of names can be overwhelming. C++ allows you a great deal of control over names: creation, visibility, placement of storage, and linkage. This chapter shows how names are controlled using two techniques. ((9)) Refferencess & tthe copy--conssttructtor.. C++ pointers work like C pointers with the additional benefit of stronger C++ type checking. There’s a new way to handle addresses; from Algol and Pascal, C++ lifts the reference which lets the compiler handle the address manipulation while you use ordinary notation. ((10)) Operattor overlloadiing.. This feature is sometimes called “syntactic sugar.” It lets you sweeten the syntax for using your type by allowing operators as well as function calls. ((11)) Dynamiic objjectt creattiion.. How many planes will an air-traffic system have to handle? How many shapes will a CAD system need? In the general programming problem, you can’t know the quantity, lifetime or type of the objects needed by your running program. Download free ebooks of c++: Thinking in C++ 2nd edition
|
| More free ebooks | |
Free programing ebooks
Here is a brief description of the chapters contained in this ebook: