- 博客(7)
- 收藏
- 关注
原创 C++ Chapter 6. Inheritance and Object-Oriented Design
1. Public inheritance means "is-a." Everything that applies to base classes must also apply to derived classes, because every derived class objectis a base class object.2.When compilers see the us
2012-04-27 13:19:08 695
转载 C++ Review: Function pointer & Function object(functor)
Function Pointer must pointer to function with definition not just declaration.Consider the following function:int f(char a, float b);The type of this function is different depending on whether
2012-04-27 01:26:15 1643 1
原创 C++ Chapter 5. Implementations
1. Postpone variable definitions as long as possible. It increases program clarity and improves program efficiency. Not only should you postpone a variable's definition until right before you have to
2012-04-25 11:39:21 530
原创 C++ Chapter 4. Designs and Declarations
1.Once the right types are in place, it can sometimes be reasonable to restrict the values of those types. For example, there are only 12 valid month values, so theMonth type should reflect that.
2012-04-07 11:43:25 406
原创 C++ Chapter 3. Resource Management
1.Many resources are dynamically allocated on the heap, are used only within a single block or function, and should be released when control leaves that block or function. The standard library'sauto_p
2012-04-04 11:43:23 524
原创 C++ Chapter 2. Constructors, Destructors, and Assignment Operators
1.compilers will declare their own versions of a copy constructor, a copy assignment operator, and a destructor. Furthermore, if you declare no constructors at all, compilers will also declare a defau
2012-04-03 12:09:13 520
原创 C++ Chapter 1. Accustoming Yourself to C++
1. For an object, the definition is where compilers set aside memory for the object. For a function or a function template, the definition provides the code body. For a class or a class template, the
2012-04-02 06:07:09 778
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人