[理工] 中央資工在職98年考題5
5. Consider the right figure which shows a code piece. Let's
assume that Object is a pre-defined C++ class. What is the
correct order that the system invokes each Object's destructor?
(a>obj1 obj2 obj3 obj4 ojb5 obj6
<b>obj3 obj4 obj2 obj6 obj5 obj1
<c>obj5 obj6 obj4 obj3 obj2 obj1
<d>obj5 obj6 obj2 obj4 obj3 obj1
<e>None of the above
程式片斷如下
.......
void create(void);
Object obj1;
int main(){
Object obj2;
static Object obj3;
create();
return 0;
}
void create(){
static Object obj4;
{Object obj5;}
Object obj6;
}
-----------------------------------------
看了EffectiveC++後,還是不太了解,請有志之士幫忙,謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.83.170.122