Alx09

Untitled

Oct 20th, 2020
872
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Student
  2. {
  3.     char *name, *rol, *adresa;
  4.     int  cod_postal;
  5. public:
  6.     Student() {}
  7.     Student(char *, char *,  char*, int);//Constructor
  8.     ~Student();//Destructor
  9.     void afisare_date();
  10. };
  11. //constructor
  12. Student::Student(char *name, char *rol, char* adresa, int cod_postal)
  13. {
  14.     this->name = new char[strlen(name) + 1];
  15.     strcpy(this->name, name);
  16.     this-> rol = new char[strlen(rol) + 1];
  17.     strcpy(this->rol, rol);
  18.     this->adresa = new char[strlen(adresa) + 1];
  19.     strcpy(this->adresa, adresa);
  20.  
  21.     this->cod_postal = cod_postal;
  22. }
RAW Paste Data