??Ч??????????й??????
???????????? ???????[ 2013/1/14 10:26:04 ] ????????
???????????????????????????ó?????????const??????????????????????????????
Image * const pImg; //???
Voice * const pVoi; //????
???????????????ó????????б??????????????????????????const???????
People::People( const std::string& n??const int& a??const int& h??const std::stirng& imgFileName??const std::string& vFileName )
:name(n)??age(a)??height(h)??
pImg( imgFileName !="" ? new Image( imgFileName ) : 0 )??
pVoi( vFileName != "" ? new Voice( vFileName ) : 0)
{}
?????????????????????????????????????????????????????????????????????????檔?????????????????????и???????£?
People::People( const std::string& n??const int& a??const int& h??const std::stirng& imgFileName??const std::string& vFileName )
:name(n)??age(a)??height(h)??
pImg( initImage( imgFileName ) )??
pVoi( initVoice( vFileName ) )
{}
Image* People::initImage(const string& imgFileName)
{
if(imgFileName !="") return new Image(imgFileName);
else return 0;
}
Voice* People::initVoice(const string& vFileName)
{
try
{
if(vFileName !="")return new Voice(vFileName)
esle return 0;
}
catch(... )
{
delete pImg;
throw;
}
}
????????????ù???Voice?????м???try...catch...???????pImg???????????????????????????????????????????
const auto_ptr<Image> pImg;
const auto_ptr<Voice> pVoi;
People::People( const std::string& n??const int& a??const int& h??const std::stirng& imgFileName??const std::string& vFileName )
:name(n)??age(a)??height(h)??
pImg( imgFileName !="" ? new Image( imgFileName ) : 0 )??
pVoi( vFileName != "" ? new Voice( vFileName ) : 0)
{}
??????????????????????????????????????????????????????????????????????????????????й????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11