到这里为止,我们学习了如何声明一个类,如何初始化它们,以及继承的一些基础。
So far, we've covered how to declare classes, how to instantiate them, and some of the basics of inheritance.
清单5 - 8演示了如何构造并初始化一个数组和两个一般集合库中的类。
Listing 5-8 demonstrates how to construct and initialize an array and two classes from the generic collection library.
如何实例化一个具体类初始化粘合剂?
每个类都可能会定义一个或几个特殊的成员函数(第1.5.2节)来告诉我们如何初始化类类型的变量。
Each class may define one or more special member functions (Section 1.5.2, p. 24) that say how we can initialize variables of the class type.
每个类都可能会定义一个或几个特殊的成员函数(第1.5.2节)来告诉我们如何初始化类类型的变量。
Each class may define one or more special member functions (Section 1.5.2, p. 24) that say how we can initialize variables of the class type.
应用推荐