w*0
2 楼
The author in Item 11, said something about copy and assignment constructor
In following code, last line ,the author said a.data is already deleted
but I wrote a program, and did test. find the value is still there. thanks.
String a("Hello"); // define and construct a
{ // open new scope
String b("World"); // define and construct b
...
b = a; // execute default op=,
In following code, last line ,the author said a.data is already deleted
but I wrote a program, and did test. find the value is still there. thanks.
String a("Hello"); // define and construct a
{ // open new scope
String b("World"); // define and construct b
...
b = a; // execute default op=,
q*3
3 楼
在HP HOME买的,现$23转+your label,或者$27包邮usps first class,有兴趣的请站
内联系,谢谢
内联系,谢谢
f*4
5 楼
Effective C++ Item 11 没看到你这个例子
但是,new scope里面的string b在出scope之后delete了,而不是a
但是,new scope里面的string b在出scope之后delete了,而不是a
w*0
7 楼
hi Brother,
Yes, It has.
Item 11: Declare a copy constructor and an assignment operator for classes
with dynamically allocated memory.
Just because b out of scope, b was deleted.
we have b = a;
so b.data point to a.data
b delete, b.data and a.data was deleted too.
so the author said a.data is already deleted
but I use cout, it can print out a.data. weird.
【在 f****4 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: Effective C++ Item 11 没看到你这个例子
: 但是,new scope里面的string b在出scope之后delete了,而不是a
Yes, It has.
Item 11: Declare a copy constructor and an assignment operator for classes
with dynamically allocated memory.
Just because b out of scope, b was deleted.
we have b = a;
so b.data point to a.data
b delete, b.data and a.data was deleted too.
so the author said a.data is already deleted
but I use cout, it can print out a.data. weird.
【在 f****4 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: Effective C++ Item 11 没看到你这个例子
: 但是,new scope里面的string b在出scope之后delete了,而不是a
z*e
9 楼
兄台,贴代码。String的实现。
s*i
10 楼
除了HD,我们这里有些超市比如Fred Meyer,Top Food,QFC,Safeway都见过
g*1
11 楼
string 和 String差别很大。不要搞混了
m*9
12 楼
今天居然在dollar tree看到种子,虽然种类不多
-原来很多店都有
-原来很多店都有
l*0
13 楼
我都在homedepot买。
黄瓜,辣椒,番茄,白菜,包菜,豆角,南瓜等等都有的。
黄瓜,辣椒,番茄,白菜,包菜,豆角,南瓜等等都有的。
相关阅读
有牛人给我Asus手机unlock么 重金酬谢一个youtube的小窍门LG的sprint手机能加入中国电信吗?乐视盒子的影迷俱乐部还能用吗父母探亲手机卡为啥我的计算机看不到moto e?求推荐:安卓手机查充电次数的软件大家用啥天气 锁屏app?Unlock的手机上了ringplus以后IOS上有哪些App支持Mitbbs俱乐部的求助:moto E的R+不能打或接电话r+ 4000/4000/4000拉里佩奇 出来,说说看桌上哪杯是茅台?微信群管理你们说的r+ 4/17是什么情况?用T-MOBILE网络,band 12重要吗?PCIe-NVMe 比 Sata 3 好很多吗?verizon买的LG G4坏了去哪里修?水果完蛋其实是Tmobile惹的祸YouTube万岁 一统浆糊