class erp
{
HR* m_hr;
FI* m_fi;
public:
erp()
{
m_hr = new HR();
m_fi = new FI();
}
erp()
{
}
};
if "new FI()" failed in the constructor, how can you detect this problem and release the properly
allocated member pointer m_hr?
1. 如果 new FI 失败,怎么释放 m_hr?
2. 如果 new HR 失败,怎么办?
最好给出完整的解答和解释