Shop smart & save big on the best selection of musical instruments and gear already marked down to the lowest prices around. Order by November 22 and take 10% off your next order of $150 or more. Just mention your one-time VIP Gift Coupon Code GU828176 when you order by phone at 877-207-0413. Hurry—this limited time offer ends November 22, 2010! 10% discount valid from November 1 to November 22, 2010 on orders valued $ 150 or more. Not valid on past orders. Due to manufacturer restrictions not all items qualify for discount. Call for details.
B*S
4 楼
A derived object may access the protected members of its base class only through a derived object. The derived class has no special access to the protected members of base type objects. 真是你妹啊。
【在 B****S 的大作中提到】 : A derived object may access the protected members of its base class only : through a derived object. The derived class has no special access to the : protected members of base type objects. : 真是你妹啊。
〉〉“真是你妹啊” 这段话有什么问题吗?首先,你漏掉了这段话前的 "In Addition, protected has another important property: A derived object...." 在结合书中这段话后面的的例子, 这段话的意思非常清楚了。并无冗余。 以下是摘要全段: In addition, protected has another important property: · A derived object may access the protected members of its base class only through a derived object. The derived class has no special access to the protected members of base type objects. As an example, let's assume that Bulk_item defines a member function that takes a reference to a Bulk_item object and a reference to an Item_base object. This function may access the protected members of its own object as well as those of its Bulk_item parameter. However, it has no special access to the protected members in its Item_base parameter: void Bulk_item::memfcn(const Bulk_item &d, const Item_base &b) { // attempt to use protected member double ret = price; // ok: uses this->price ret = d.price; // ok: uses price from a Bulk_item object ret = b.price; // error: no access to price from an Item_base } The use of d.price is okay, because the reference to price is through an object of type Bulk_item. The use of b.price is illegal because Bulk_item has no special access to objects of type Item_base.
B*S
12 楼
难道我的英语不过关?
only
【在 c*****n 的大作中提到】 : 〉〉“真是你妹啊” : 这段话有什么问题吗?首先,你漏掉了这段话前的 "In Addition, protected has : another important property: A derived object...." : 在结合书中这段话后面的的例子, 这段话的意思非常清楚了。并无冗余。 : 以下是摘要全段: : In addition, protected has another important property: : · A derived object may access the protected members of its base class only : through a derived object. The derived class has no special access to the : protected members of base type objects. : As an example, let's assume that Bulk_item defines a member function that