//******************************************* //in this test I use object array in run-time //allocation //******************************************* #include #include #include using namespace std; //--------------------------------------------- class id{ char name[10]; char surname[10]; public: id(){}; ~id(){cout<<"Deleting id..\n";} void setid(char *na,char *sur){ strcpy(name,na); strcpy(surname,sur); } void show(char *na,char *sur){ strcpy(na,name); strcpy(sur,surname); } }; //=============================================== int main(){ id *p; char name[10]; char surname[10]; try{ p=new id [3]; }catch(bad_alloc xa){ cout<<"Allocation error!\n"; return 1; } p[0].setid("luciano","d'eugenio"); p[1].setid("stefania","d'eugenio"); p[2].setid("antonello","rota"); for(int i=0;i<3;i++){ p[i].show(name,surname); cout<