由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - vector的析构问题
相关主题
map析构这个dtor为啥能被调用呢
vector析构的时候怎么办?几个问题
急,VC7.1编译错误如何在fortran中定义一个动态的数组?
STL/vector引用成员变量。C++的"初始化"小结
请问释放容器内存的方法问一个 Andrei A. 的 Modern c++ design 书里边的一个问题
关于内存泄漏再请教两道QuantC++面试题
一个C++的问题还没被劝退C++的都来看看这个吧
why do we still use dynamic allocation?现在iOS的内存管理是怎么样的?
相关话题的讨论汇总
话题: num话题: parent话题: int话题: vector话题: children
进入Programming版参与讨论
1 (共1页)
l********a
发帖数: 1154
A**u
发帖数: 2458
2
你这code写的太复杂了
看晕了哎
l********a
发帖数: 1154
3
就是个类自己包含自己的例子
例如,html的tag,


<...>


<...>
<...>
<...>


如果我用这个类A表示一个tag,每个tag下面可能有其他tag,都看做它的孩子,这样可以
对这些tag做相同的处理,如果没有孩子,它的children vector就是空的,现在需要写一
个析构函数来析构,由于vector存放的是指针形式A *,构造函数也能看出来每一个孩子
都是new出来的,调试的报错的确是在
void deallocate(pointer _Ptr, size_type)
{ // deallocate object at _Ptr, ignore size
::operator delete(_Ptr);
}
往上追踪看的确是这个类的析构函数出错了,不能delete?但是现在的析构函数从流程上
好像是对的,比较郁闷
t****t
发帖数: 6806
4
A::~A() { for (auto i: children) delete i; }

【在 l********a 的大作中提到】
: 前几天问过一个类的初始化问题
: class A
: {
: public:
: int num;
: A *parent;
: vector children;
: ...
: // 无参数调用
: A(void)

b***i
发帖数: 3043
5
children->parent=a 是什么意思?

【在 l********a 的大作中提到】
: 前几天问过一个类的初始化问题
: class A
: {
: public:
: int num;
: A *parent;
: vector children;
: ...
: // 无参数调用
: A(void)

l********a
发帖数: 1154
6

就是如果构造函数传入第一个参数是当前构造对象的父指针
A::A(A* a,int)
{
this->parent = a;
...
}

【在 b***i 的大作中提到】
: children->parent=a 是什么意思?
l********a
发帖数: 1154
7

auto会报错,
我写成类似这样的,还是会出错
for (int i=0;i<(int)(this->children_.size());++i)
{
A *temp = this->children_[i];
delete temp;
}

【在 t****t 的大作中提到】
: A::~A() { for (auto i: children) delete i; }
b***i
发帖数: 3043
8
but Children is not A, it's vector

【在 l********a 的大作中提到】
:
: auto会报错,
: 我写成类似这样的,还是会出错
: for (int i=0;i<(int)(this->children_.size());++i)
: {
: A *temp = this->children_[i];
: delete temp;
: }

l********a
发帖数: 1154
9

children在this中是一个vector
有参构造函数中是.push_back(new A(this,n))这种形式添加到this->children的
每一个child都是A *保存在这个vector中,
就看做是html的tag吧,


<br /> </head><br /> <body>...</body><br /> </html><br /> 那html这个tag的parent=0,children.size()==2<br /> html.children[0] = &head (由于是递归初始化,添加的时候能得到head的地址)<br /> html.children[1] = &body<br /> head这个tag的parent = &html,children.size()==1<br /> head.children[0] = title<br /> title和body的children.size()==0,是个空vector<br /> parent分别是 &head 和 &html<br /> <br />【在 b***i 的大作中提到】<a href="#post8"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: but Children is not A, it's vector<A* ></span><br /></span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg"><div id="post10" style="position:relative"><div class="zt-counter">10</div><span>this is c++11, but you got the essence. in any case, you have other bug in<br /> your code.<br /> <br />【在 l********a 的大作中提到】<a href="#post9"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: <br />: children在this中是一个vector<A *><br />: 有参构造函数中是.push_back(new A(this,n))这种形式添加到this->children的<br />: 每一个child都是A *保存在这个vector中,<br />: 就看做是html的tag吧,<br />: <html><br />: <head><br />: <title><br />: </head><br />: <body>...</body></span><br /></span></div></td></tr><tr><td colspan=2 style="padding-bottom:15px"><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><th colspan=2 style="color:#F52887;font-size:105%">相关主题</th></tr><tr><td width=50%>● <a href="/zhuti/Programming/616686/">关于内存泄漏</a></td><td>● <a href="/zhuti/Programming/31217705/">这个dtor为啥能被调用呢</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/29480999/">一个C++的问题</a></td><td>● <a href="/zhuti/Programming/24959065/">几个问题</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31163373/">why do we still use dynamic allocation?</a></td><td>● <a href="/zhuti/Programming/28443517/">如何在fortran中定义一个动态的数组?</a></td></tr><tr><td colspan=2 style="font-size:120%;text-align:center;padding-top:15px"><a href="//forum.weiming.info/c/328" style="color:#F52887;font-weight:bold;text-decoration:underline">进入Programming版参与讨论</a></td></tr></table></td></tr><tr><td colspan=2><div style="margin:10px 0"></div></td></tr><tr><td class="zt-author">l********a<br />发帖数: 1154</td><td width=80% class="zt-bg2"><div id="post11" style="position:relative"><div class="zt-counter">11</div><span><br /> 多谢,继续调试中.<br /> <br />【在 t****t 的大作中提到】<a href="#post10"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: this is c++11, but you got the essence. in any case, you have other bug in<br />: your code.</span><br /></span></div></td></tr><tr><td class="zt-author">j*****g<br />发帖数: 16</td><td width=80% class="zt-bg"><div id="post12" style="position:relative"><div class="zt-counter">12</div><span>摸黑写了一下,可是编译(g++ A.cpp)出错, 就是this->children->parent<br /> A.cpp:20: error: base operand of ‘->’ has non-pointer type ‘std::vector<A<br /> *, std::allocator<A*> >’<br /> A.cpp<br /> //******************************<br /> 1 #include <vector><br /> 2 class A<br /> 3 {<br /> 4 public:<br /> 5 int num;<br /> 6 A *parent;<br /> 7 std::vector<A *> children;<br /> 8 public:<br /> 9 A(){<br /> 10 this->num=3;<br /> 11 this->parent=0;<br /> 12 for (int i=0;i<this->num;++i)<br /> 13 {<br /> 14 this->children.push_back(new A(this,this->num));<br /> 15 }<br /> 16 }<br /> 17 A(A *a, int n)<br /> 18 {<br /> 19 this->num=n;<br /> 20 this->children->parent=a;<br /> 21 for (int i=0; i<this->num; ++i)<br /> 22 {<br /> 23 this->children.push_back(new A(this, this->num-1));<br /> 24 }<br /> 25 }<br /> 26 };<br /> 27<br /> 28 int main(void)<br /> 29 {<br /> 30 A aa;<br /> 31 }//***********************************</span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg2"><div id="post13" style="position:relative"><div class="zt-counter">13</div><span>你这写的什么破烂?<br /> <br /> <A<br /> <br />【在 j*****g 的大作中提到】<a href="#post12"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 摸黑写了一下,可是编译(g++ A.cpp)出错, 就是this->children->parent<br />: A.cpp:20: error: base operand of ‘->’ has non-pointer type ‘std::vector<A<br />: *, std::allocator<A*> >’<br />: A.cpp<br />: //******************************<br />: 1 #include <vector><br />: 2 class A<br />: 3 {<br />: 4 public:<br />: 5 int num;</span><br /></span></div></td></tr><tr><td class="zt-author">j*****g<br />发帖数: 16</td><td width=80% class="zt-bg"><div id="post14" style="position:relative"><div class="zt-counter">14</div><span>简单测试一下楼主的class, 发现这句不能compile:<br /> this->children->parent = a;<br /> main.cpp: In constructor ‘A::A(A*, int)’:<br /> main.cpp:25:<br /> error: base operand of ‘->’ has non-pointer type ‘std::vector<A*, std::<br /> allocator<A*> >’<br /> 这是为什么呢?多谢!<br /> <br />【在 t****t 的大作中提到】<a href="#post13"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 你这写的什么破烂?<br />: <br />: <A</span><br /></span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg2"><div id="post15" style="position:relative"><div class="zt-counter">15</div><span>他显然只是东拼西凑了一小段给你看一下, 你只能看个意思, copy paste是不成的<br /> <br />【在 j*****g 的大作中提到】<a href="#post14"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 简单测试一下楼主的class, 发现这句不能compile:<br />: this->children->parent = a;<br />: main.cpp: In constructor ‘A::A(A*, int)’:<br />: main.cpp:25:<br />: error: base operand of ‘->’ has non-pointer type ‘std::vector<A*, std::<br />: allocator<A*> >’<br />: 这是为什么呢?多谢!</span><br /></span></div></td></tr><tr><td class="zt-author">d***q<br />发帖数: 1119</td><td width=80% class="zt-bg"><div id="post16" style="position:relative"><div class="zt-counter">16</div><span>use<br /> shared_ptr</span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg2"><div id="post17" style="position:relative"><div class="zt-counter">17</div><span>你不用来来回回重复说明你的设计, 这个设计很简单, 大家都看明白了<br /> 大家问的是你混乱的语法问题, 你either没贴对or没贴全<br /> <br />【在 l********a 的大作中提到】<a href="#post11"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: <br />: 多谢,继续调试中.</span><br /></span></div></td></tr><tr><td class="zt-author">l********a<br />发帖数: 1154</td><td width=80% class="zt-bg"><div id="post18" style="position:relative"><div class="zt-counter">18</div><span>不好意思,原class是个非常大的类,为了说问题简单,<br /> 我手打的时候,把带参数的构造函数那句写错了,应该是<br /> this->parent = a;<br /> 不是this->children->parent = a;<br /> 下面的测试用例复制可以编译运行的<br /> #include <string><br /> #include <vector><br /> using namespace std;<br /> #include <iostream><br /> class A<br /> {<br /> public:<br /> int num;<br /> A *parent;<br /> vector<A *> children;<br /> // 无参数调用<br /> A(void)<br /> {<br /> this->num = 3;<br /> this->parent = 0;<br /> for (int i=0;i<this->num;++i)<br /> this->children.push_back(new A(this,this->num-1));<br /> }<br /> // 子构造函数,被上面的无参函数调用<br /> A(A *a,int n)<br /> {<br /> this->num = n;<br /> this->parent = a;<br /> for (int i=0;i<this->num;++i)<br /> this->children.push_back(new A(this,this->num-1));<br /> }<br /> };<br /> int main()<br /> {<br /> A aa;<br /> cout << aa.children.size() << endl;<br /> }<br /> <br /> <A<br /> <br />【在 j*****g 的大作中提到】<a href="#post12"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 摸黑写了一下,可是编译(g++ A.cpp)出错, 就是this->children->parent<br />: A.cpp:20: error: base operand of ‘->’ has non-pointer type ‘std::vector<A<br />: *, std::allocator<A*> >’<br />: A.cpp<br />: //******************************<br />: 1 #include <vector><br />: 2 class A<br />: 3 {<br />: 4 public:<br />: 5 int num;</span><br /></span></div></td></tr><tr><td class="zt-author">b***i<br />发帖数: 3043</td><td width=80% class="zt-bg2"><div id="post19" style="position:relative"><div class="zt-counter">19</div><span>这就对了,你写好一个snippet,然后我们放到codepad.org上运行,就可以继续讨论了<br /> 另外,你那个A::~A里面的swap是谁跟谁?什么目的?<br /> <br />【在 l********a 的大作中提到】<a href="#post18"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 不好意思,原class是个非常大的类,为了说问题简单,<br />: 我手打的时候,把带参数的构造函数那句写错了,应该是<br />: this->parent = a;<br />: 不是this->children->parent = a;<br />: 下面的测试用例复制可以编译运行的<br />: #include <string><br />: #include <vector><br />: using namespace std;<br />: #include <iostream><br />: class A</span><br /></span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg"><div id="post20" style="position:relative"><div class="zt-counter">20</div><span>that is most probably copied from effective STL or some other book to "<br /> really" release the vector memory. but it's actually not needed.<br /> <br />【在 b***i 的大作中提到】<a href="#post19"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 这就对了,你写好一个snippet,然后我们放到codepad.org上运行,就可以继续讨论了<br />: 另外,你那个A::~A里面的swap是谁跟谁?什么目的?</span><br /></span></div></td></tr><tr><td colspan=2 style="padding-bottom:15px"><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><th colspan=2 style="color:#F52887;font-size:105%">相关主题</th></tr><tr><td width=50%>● <a href="/zhuti/Programming/31224219/">C++的"初始化"小结</a></td><td>● <a href="/zhuti/Programming/31389463/">还没被劝退C++的都来看看这个吧</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31224247/">问一个 Andrei A. 的 Modern c++ design 书里边的一个问题</a></td><td>● <a href="/zhuti/Programming/31409379/">现在iOS的内存管理是怎么样的?</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31228539/">再请教两道QuantC++面试题</a></td><td>● <a href="/zhuti/Programming/31394533/">什么是OS Memory management and heap structure?</a></td></tr><tr><td colspan=2 style="font-size:120%;text-align:center;padding-top:15px"><a href="//forum.weiming.info/c/328" style="color:#F52887;font-weight:bold;text-decoration:underline">进入Programming版参与讨论</a></td></tr></table></td></tr><tr><td colspan=2><div style="margin:10px 0"></div></td></tr><tr><td class="zt-author">l********a<br />发帖数: 1154</td><td width=80% class="zt-bg2"><div id="post21" style="position:relative"><div class="zt-counter">21</div><span><br /> 这是从书上看的,说是vector退出code block并不会真正释放内存<br /> 需要跟空vector来swap交换,所以才加上去的<br /> 我看报错的位置,应该是deallocate的时候出错了,跟swap这句关系好像不大<br /> 我每次跟踪调试到那个delete _Ptr那句的时候,就没有上下文了,找不到到底哪里出的<br /> 错,但是vs ide的函数调用堆栈前面几个倒都是A **的析构,可能析构A *的时候编译器<br /> 需要A *的地址<br /> <br />【在 b***i 的大作中提到】<a href="#post19"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 这就对了,你写好一个snippet,然后我们放到codepad.org上运行,就可以继续讨论了<br />: 另外,你那个A::~A里面的swap是谁跟谁?什么目的?</span><br /></span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg"><div id="post22" style="position:relative"><div class="zt-counter">22</div><span>you read it wrong -- it said when you clear() the vector, or pop_back(), or<br /> erase(), it probably won't release the memory.<br /> but when you delete the vector, it will and it must.<br /> read book carefully.<br /> <br />【在 l********a 的大作中提到】<a href="#post21"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: <br />: 这是从书上看的,说是vector退出code block并不会真正释放内存<br />: 需要跟空vector来swap交换,所以才加上去的<br />: 我看报错的位置,应该是deallocate的时候出错了,跟swap这句关系好像不大<br />: 我每次跟踪调试到那个delete _Ptr那句的时候,就没有上下文了,找不到到底哪里出的<br />: 错,但是vs ide的函数调用堆栈前面几个倒都是A **的析构,可能析构A *的时候编译器<br />: 需要A *的地址</span><br /></span></div></td></tr><tr><td class="zt-author">b***i<br />发帖数: 3043</td><td width=80% class="zt-bg2"><div id="post23" style="position:relative"><div class="zt-counter">23</div><span>那你就作出一个能出错的snippet,放到codepad上出错,再贴出来代码,好吗?<br /> 另外,你怎么不用delete,而是直接~?<br /> <br />【在 l********a 的大作中提到】<a href="#post21"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: <br />: 这是从书上看的,说是vector退出code block并不会真正释放内存<br />: 需要跟空vector来swap交换,所以才加上去的<br />: 我看报错的位置,应该是deallocate的时候出错了,跟swap这句关系好像不大<br />: 我每次跟踪调试到那个delete _Ptr那句的时候,就没有上下文了,找不到到底哪里出的<br />: 错,但是vs ide的函数调用堆栈前面几个倒都是A **的析构,可能析构A *的时候编译器<br />: 需要A *的地址</span><br /></span></div></td></tr><tr><td class="zt-author">l********a<br />发帖数: 1154</td><td width=80% class="zt-bg"><div id="post24" style="position:relative"><div class="zt-counter">24</div><span><br /> 多谢,才知道这个网站<br /> <a href="http://codepad.org/NLcZWxcd" rel="nofollow">http://codepad.org/NLcZWxcd</a><br /> 我尝试了2种~A方法,调用析构函数的注释掉了<br /> codepad上面有个Segmentation fault,应该跟析构有关<br /> 奇怪的是,我用code::blocks,gcc编译竟然没有错?2种析构都没报错<br /> <br />【在 b***i 的大作中提到】<a href="#post23"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 那你就作出一个能出错的snippet,放到codepad上出错,再贴出来代码,好吗?<br />: 另外,你怎么不用delete,而是直接~?</span><br /></span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg2"><div id="post25" style="position:relative"><div class="zt-counter">25</div><span>what is line 47 ?<br /> <br />【在 l********a 的大作中提到】<a href="#post24"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: <br />: 多谢,才知道这个网站<br />: <a href="http://codepad.org/NLcZWxcd" rel="nofollow">http://codepad.org/NLcZWxcd</a><br />: 我尝试了2种~A方法,调用析构函数的注释掉了<br />: codepad上面有个Segmentation fault,应该跟析构有关<br />: 奇怪的是,我用code::blocks,gcc编译竟然没有错?2种析构都没报错</span><br /></span></div></td></tr><tr><td class="zt-author">b***i<br />发帖数: 3043</td><td width=80% class="zt-bg"><div id="post26" style="position:relative"><div class="zt-counter">26</div><span>把显式调用~A去掉。<br /> should I call destructor explicitly?<br /> <a href="http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.5" rel="nofollow">http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.5</a><br /> <br />【在 l********a 的大作中提到】<a href="#post24"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: <br />: 多谢,才知道这个网站<br />: <a href="http://codepad.org/NLcZWxcd" rel="nofollow">http://codepad.org/NLcZWxcd</a><br />: 我尝试了2种~A方法,调用析构函数的注释掉了<br />: codepad上面有个Segmentation fault,应该跟析构有关<br />: 奇怪的是,我用code::blocks,gcc编译竟然没有错?2种析构都没报错</span><br /></span></div></td></tr><tr><td class="zt-author">l********a<br />发帖数: 1154</td><td width=80% class="zt-bg2"><div id="post27" style="position:relative"><div class="zt-counter">27</div><span>多谢2位,可能我代码哪里显式调用deconstructor了</span></div></td></tr><tr><td class="zt-author">t****t<br />发帖数: 6806</td><td width=80% class="zt-bg"><div id="post28" style="position:relative"><div class="zt-counter">28</div><span>...跟你说话真够费劲儿的. 都已经给你指出行号了你还"可能".<br /> <br />【在 l********a 的大作中提到】<a href="#post27"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: 多谢2位,可能我代码哪里显式调用deconstructor了</span><br /></span></div></td></tr><tr><td class="zt-author">l********a<br />发帖数: 1154</td><td width=80% class="zt-bg2"><div id="post29" style="position:relative"><div class="zt-counter">29</div><span><br /> 哈哈,thrust兄别恼,我是说我实际的工程代码里面调用来调用去,哪个析构函数可能去<br /> delete已经被deconstruct过的对象<br /> 不是说贴出来的例子<br /> <br />【在 t****t 的大作中提到】<a href="#post28"><img border=0 src="/moin_static193/solenoid/img/up.png" style="vertical-align:top;"/></a><br /><span class="zt-cite">: ...跟你说话真够费劲儿的. 都已经给你指出行号了你还"可能".</span><br /></span></div></td></tr> </table></td></tr> <tr><td> <div><table class="searchpages" style="float: right"><tbody><tr> <td></td> <td>1</td> <td></td> <td>(共1页)</td> </tr> </tbody></table></div> </td></tr> <tr><td><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><td style="font-size:120%;text-align:center;padding-top:15px"><a href="//forum.weiming.info/c/328" style="color:#F52887;font-weight:bold;text-decoration:underline">进入Programming版参与讨论</a></td></tr></table></td></tr> <tr><td><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><th colspan=2 style="color:#F52887;font-size:105%">相关主题</th></tr><tr><td width=50%>● <a href="/zhuti/Programming/31409379/">现在iOS的内存管理是怎么样的?</a></td><td>● <a href="/zhuti/Programming/31253411/">请问释放容器内存的方法</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31394533/">什么是OS Memory management and heap structure?</a></td><td>● <a href="/zhuti/Programming/616686/">关于内存泄漏</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31162170/">What is automatic space allocation in C++?</a></td><td>● <a href="/zhuti/Programming/29480999/">一个C++的问题</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31214007/">请教一个C++问题</a></td><td>● <a href="/zhuti/Programming/31163373/">why do we still use dynamic allocation?</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31221135/">map析构</a></td><td>● <a href="/zhuti/Programming/31217705/">这个dtor为啥能被调用呢</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31185753/">vector析构的时候怎么办?</a></td><td>● <a href="/zhuti/Programming/24959065/">几个问题</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31204785/">急,VC7.1编译错误</a></td><td>● <a href="/zhuti/Programming/28443517/">如何在fortran中定义一个动态的数组?</a></td></tr><tr><td width=50%>● <a href="/zhuti/Programming/31154198/">STL/vector引用成员变量。</a></td><td>● <a href="/zhuti/Programming/31224219/">C++的"初始化"小结</a></td></tr></table></td></tr> <tr><td><table style="table-layout:fixed;width:90%;margin-left:auto;margin-right:auto"><tr><th colspan=2 style="color:#F52887;font-size:105%">相关话题的讨论汇总</th></tr><tr><td colspan=2 style="text-align:center;padding-top:10px;font-size:1.1em"><span style="margin-right: 20px"><a href="/huati/num">话题: num</a></span><span style="margin-right: 20px"><a href="/huati/parent">话题: parent</a></span><span style="margin-right: 20px"><a href="/huati/int">话题: int</a></span><span style="margin-right: 20px"><a href="/huati/vector">话题: vector</a></span><span style="margin-right: 20px"><a href="/huati/children">话题: children</a></span></td></tr></table></td></tr> </tbody></table></div> </td></tr> </tbody></table></div> </div> <span class="anchor" id="line-3"></span><span class="anchor" id="bottom"></span></div><div id="pagebottom"></div></div><div class="sidebar"><div dir="ltr" id="SideBar.sidebar" lang="zh"><span class="anchor" id="SideBar.top"></span> <span class="anchor" id="SideBar.line-1"></span><span class="anchor" id="SideBar.line-2"></span><p class="line867"><div id="rankings"><h3>未名新帖统计<span>// 7月16日</span></h3><div><table width=100%><tr><th width=10% align=left>#</th><th width=50% align=left>版面</th><th width=40% align=left>帖数(主题数)</th></tr><tr><td>-</td><td>全站</td><td>4871 (796)</td></tr><tr><td>1</td><td><a title="军事天地" href="/board/Military/">Military</a></td><td>3777 (569)</td></tr><tr><td>2</td><td><a title="股海弄潮" href="/board/Stock/">Stock</a></td><td>341 (51)</td></tr><tr><td>3</td><td><a title="肚皮舞运动" href="/board/Joke/">Joke</a></td><td>117 (17)</td></tr><tr><td>4</td><td><a title="史海钩沉" href="/board/History/">History</a></td><td>116 (3)</td></tr><tr><td>5</td><td><a title="车轮上的传奇" href="/board/Automobile/">Automobile</a></td><td>100 (9)</td></tr><tr><td>6</td><td><a title="美国新闻" href="/board/USANews/">USANews</a></td><td>55 (9)</td></tr><tr><td>7</td><td><a title="人到中年" href="/board/Midlife/">Midlife</a></td><td>45 (1)</td></tr><tr><td>8</td><td><a title="焦点新闻" href="/board/Headline/">Headline</a></td><td>41 (41)</td></tr><tr><td>9</td><td><a title="梦里花落知多少" href="/board/Dreamer/">Dreamer</a></td><td>33 (13)</td></tr><tr><td>10</td><td><a title="二手市场" href="/board/FleaMarket/">FleaMarket</a></td><td>32 (20)</td></tr><tr><td>11</td><td><a title="家居生活" href="/board/Living/">Living</a></td><td>30 (7)</td></tr></table><p>* 这里只显示发帖超过25的版面,努力灌水吧:-)</p></div></div> <span class="anchor" id="SideBar.line-3"></span><div id="matched_content" style="margin: 5px 2px 5px 2px"></div> <span class="anchor" id="SideBar.line-4"></span> <h3 id="SideBar.A.2BU4ZT8k4KdoROylkp-">历史上的今天</h3> <span class="anchor" id="SideBar.line-5"></span><p class="line867"><div class="BlikiSummary" style="margin-bottom:1.2em;margin-left:0.5em"><ol><li><a href="/zhuti/ChineseClassics/31268413/">faintcat妹妹看进来~~</a> 发表于12年前.</li><li><a href="/zhuti/EB23/31380293/">NSC, PD 1/7/2007, EB2, ...</a> 发表于11年前.</li><li><a href="/zhuti/FleaMarket/35696181/">[FBA求购]MJVE2 758 MJVM2 ...</a> 发表于6年前.</li><li><a href="/zhuti/Parenting/31948559/">老生常谈,归与不归</a> 发表于10年前.</li><li><a href="/zhuti/board/31486231/">【申请】Seattle西雅图 版版主——申请人...</a> 发表于9年前.</li><li><a href="/zhuti/NextGeneration/36332471/">宝宝出生,头骨骨折,求祝福</a> 发表于9年前.</li><li><a href="/zhuti/ClassicalMusic/31210935/">求推荐舒缓优美的古典音乐</a> 发表于11年前.</li><li><a href="/zhuti/PhotoGear/34338217/">百分之一的北京人上北大 中国网友愤怒(转载)</a> 发表于10年前.</li><li><a href="/zhuti/pets/31825797/">新人带狗狗Bailey来报道</a> 发表于12年前.</li><li><a href="/zhuti/Football/31468183/">全世界最有价值的运动队</a> 发表于10年前.</li><li><a href="/zhuti/Automobile/35426999/">请问大切诺基的质量如何</a> 发表于6年前.</li><li><a href="/zhuti/_RuS/23459405/">TNND,军版全是BKC</a> 发表于15年前.</li><li><a href="/zhuti/_LoTaYu/31206385/">Inception</a> 发表于12年前.</li><li><a href="/zhuti/Seattle/32526849/">微软的有些家属可真恶心,为了卖保险脸都不要了</a> 发表于10年前.</li><li><a href="/zhuti/Military/39967953/">每周坐高铁的苦逼来说说感受吧!!</a> 发表于9年前.</li></ol></div> <span class="anchor" id="SideBar.line-6"></span> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2229050667028251" crossorigin="anonymous"></script> <!-- SidebarW1 --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-2229050667028251" data-ad-slot="2711874079" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <span class="anchor" id="SideBar.line-7"></span><span class="anchor" id="SideBar.bottom"></span></div><div id="sidebar-end"></div></div></div><div class="footer"><span class="license">除非另有声明,本站内容采用Creative Commons BY-NC-SA 3.0协议进行许可,转载请注明来自<a href="/">未名观察</a> - <a href="/PrivacyPolicy">隐私政策</a></span><span class="time" lang="zh" dir="ltr">2011-07-24 10:06:12由<span title="admin"><a href="/admin" title="admin">admin</a></span>编辑</span> </div> <script> var _gaq=[['_setAccount','UA-18482428-3'],['_trackPageview'],['_trackPageLoadTime']]; (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script')); </script> <script type="text/javascript" src="http://s.skimresources.com/js/27394X857871.skimlinks.js"></script> </body> </html>