Absolute C++ (phần 7) potx
... in C, not C++. 16. When you define a C++ class, should you make the member variables public or private? Should you make the member functions public or private? 17. When you define a C++ class, ... member functions. However, in C++ a structure can have private member variables and both public and private member functions. Aside from some notational differences, a C++ structure can d...
Ngày tải lên: 07/07/2014, 05:20
Absolute C++ (phần 2) potx
... < 3) || (y > 7) ) which might be the controlling expression for an if-else statement. Suppose the value of y is 8. In this case (y < 3) evaluates to false and (y > 7) evaluates to true, ... C AN B E U SED AS B OOLEAN V ALUES C++ sometimes uses integers as if they were Boolean values and bool values as if they were inte- gers. In particular, C++ converts the integer...
Ngày tải lên: 07/07/2014, 05:20
Absolute C++ (phần 16) potx
... explain the details of virtual functions in C++, we will use a simplified example from an application area other than drawing figures. ■ VIRTUAL FUNCTIONS IN C++ Suppose you are designing a record-keeping ... 641 Pitfall: The Slicing Problem 645 Tip: Make Destructors Virtual 646 Downcasting and Upcasting 647 How C++ Implements Virtual Functions 649 CHAPTER SUMMARY 650 ANSWERS TO SELF-TE...
Ngày tải lên: 07/07/2014, 05:20
Absolute C++ (phần 20) potx
... a collection of libraries written in the C++ language. Although the STL is not part of the core C++ language, it is part of the C++ standard, and so any implementation of C++ that conforms to the standard ... program to illustrate some C++ details about exception handling. It uses much too much machinery for such a simple task, but it is an other- wise uncluttered example of some C...
Ngày tải lên: 07/07/2014, 05:20
Absolute C++ (phần 22) potx
... a programming language such as C++ and a natural language such as English. To think about a programming problem without needing to worry about the syntax details of a language such as C++, you can simply ... same base type. UML One picture is worth a thousand words. Chinese proverb People do not think in C++ or in any other programming language. As a result, com- puter scientists have al...
Ngày tải lên: 07/07/2014, 05:20