??????????????????????Щ???????????????????????Ч????д????????????й????????????????????????????δ???


class Image
{
    public:
        Image(const std::string& imgFileName);
        ...
}

class Voice
{
    public:
        Voice(const std::string& vFileName);
        ...
}

class People
{
    public:
            People(const std::string& n??const int& a??const int& h??const std::stirng& imgFileName??const std::string& vFileName);
            ~People( );
    private:
            string name;
            int       age;
            int       height;
            Image *pImg;          //???
            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(0)??pVoi(0)
{
        if(imgFileName != "")
        {
            pImg = new Image( imgFileName ) ;
        }
        if(vFileName != " ")
        {
            pVoi = new Voice ( vFileName );
        }
}

People::~People( )
{
        delete pImg;
        delete pVoi;
}
 


??????????????????????????????????????People?????????????治???????????棩?????????????????????????????????????????????????????????????Image????????????Voice??????????????????????????????????????????????????????У????pImg???????????治???????????????????й????????????????


...
People *p =NULL;
try{
    p=new People("test"??20??170??".../images/image01.jpg"??"../voices/voice01.dat");
    ...
catch( ... ){
    delete p;
    throw;
 }
 delete p;
}


??????????? new People("test"??20??170??".../images/image01.jpg"??"../voices/voice01.dat")????????Image???????汻????????new??????г????????????p???и????????????catch????????κβ????????????????涪????

?????????????????????????C++??????????????????????????????????????????????????????????????????????檔


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(0)??pVoi(0)
{
    try {
        if(imgFileName != "")
        {
            pImg = new Image( imgFileName ) ;
        }
        if(vFileName != " ")
        {
            pVoi = new Voice ( vFileName );
        }
    }
    catch( ...) {
        delete pImg ;
        delete pVoi;
        throw ;