Redian新闻
>
C++ Primer 上关于inheritance protected member 的一段话
avatar
C++ Primer 上关于inheritance protected member 的一段话# Programming - 葵花宝典
a*y
1
是不是回国的飞机上把I-94收走,然后回来是子啊发新的?
avatar
q*l
2
去年的身份还是H4,今年一月开始是F1,想问一下我现在填turbotax的时候个人是填学
生吗?谢谢
avatar
w*d
3
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.
avatar
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.
真是你妹啊。
avatar
t*n
5


【在 a***y 的大作中提到】
: 是不是回国的飞机上把I-94收走,然后回来是子啊发新的?
avatar
M*l
6
no. H4.

【在 q***l 的大作中提到】
: 去年的身份还是H4,今年一月开始是F1,想问一下我现在填turbotax的时候个人是填学
: 生吗?谢谢

avatar
t*n
7
技术牛人写书就是这风格。所以教书匠不一定是牛人,牛人不一定适合教书。

【在 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.
: 真是你妹啊。

avatar
q*l
8
有一项就是occupation的,不是问职业的意思吗,我现在是学生了,还是需要填
homemaker吗?

【在 M*********l 的大作中提到】
: no. H4.
avatar
B*S
9
C++出来的还是太早了,设计上面太多的否定之否定,什么情况都想cover。搞得细节太多。
技术牛人就是这种风格,以为其他人都和他一样牛。
别人还要干别的事情,又不是和他一样把所有时间都花在那个上面了。能帮助别人省时
间的才是牛人。

【在 t*****n 的大作中提到】
: 技术牛人写书就是这风格。所以教书匠不一定是牛人,牛人不一定适合教书。
avatar
t*n
10
这也不是缺点。每种语言都有垃圾冗余的地方。只看细节,没啥意思。语言就是来干活
的。

多。

【在 B****S 的大作中提到】
: C++出来的还是太早了,设计上面太多的否定之否定,什么情况都想cover。搞得细节太多。
: 技术牛人就是这种风格,以为其他人都和他一样牛。
: 别人还要干别的事情,又不是和他一样把所有时间都花在那个上面了。能帮助别人省时
: 间的才是牛人。

avatar
c*n
11
〉〉“真是你妹啊”
这段话有什么问题吗?首先,你漏掉了这段话前的 "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.
avatar
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

avatar
m*l
13
clas != object

【在 B****S 的大作中提到】
: 难道我的英语不过关?
:
: only

avatar
l*s
14
还以为这本是给初学者用的,看来还是有点花头的。
avatar
B*S
15
理论上,c++ primer应该包括所有东西了,虽然细节未必面面俱到。

【在 l*********s 的大作中提到】
: 还以为这本是给初学者用的,看来还是有点花头的。
avatar
B*S
16
class里面函数还调用class本身的object,这种做法应该不值得推广把。很容易死循环
阿。

【在 m*******l 的大作中提到】
: clas != object
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。