Professional Documents
Culture Documents
#define _CRT_SECURE_NO_WARNINGS
#include<fstream>
class Profesor
{
private:
char* nume;
int* nrActivitati;
int vechime;
char facultate[10];
public:
Profesor()
{
this->nume = NULL;
this->vechime = 0;
this->nrActivitati = NULL;
strcpy(this->facultate, "None");
}
if (prof.nume != NULL)
{
this->nume = new char[strlen(prof.nume) + 1];
strcpy(this->nume, prof.nume);
}
else
this->nume = NULL;
this->vechime = prof.vechime;
if (prof.nrActivitati != NULL)
{
this->nrActivitati = new int[vechime];
for (int i = 0; i < vechime; i++)
this->nrActivitati[i] = prof.nrActivitati[i];
}
else
this->nrActivitati = NULL;
strcpy(this->facultate, prof.facultate);
return *this;
}
~Profesor()
{
if (this->nume != NULL)
delete[] this->nume;
if (this->nrActivitati != NULL)
delete[] this->nrActivitati;
}
//ofstream fOut;
//fOut.open("profesori.txt", ios::out);
//fOut << 4 << endl;for (int i = 0;i < 4;i++)
//{
// fOut << listaProfesori[i];
//}
// sa se creeze fisierul profiSortati.txt care sa contina nr de profesori pe prima linie, iar dupa aceea sa
apara
// fiecare profesori, sortati dupa vechime, doar cei