Professional Documents
Culture Documents
Cursa Aeriana PDF
Cursa Aeriana PDF
#include <conio.h>
#include<stdio.h>
#include<string.h>
class cursaAeriana
{
private:
const int codZbor;
char* destinatie;
int durataZbor;
static int nrZbor;
public:
//get si set
char* get_destinatie()
{
return this->destinatie;
}
{
if (strlen(destinatie))
{
delete[] this->destinatie;
this->destinatie = new char[strlen(destinatie) + 1];
strcpy(this->model, destinatie);
}
}
this->destinatie=new char[strlen(destinatie)+1];
strcpy(strlen(destinatie)+1,"destinatie");
this->durataZbor = 0;
nrZbor++
}
//constructor cu parametri
this->destinatie=new char[strlen(destinatie)+1];
strcpy(strlen(destinatie)+1,destinatie);
this->durataZbor = durataZbor;
nrZbor++;
//constructor de copiere
//destructor
~cursaAeriana()
{
if (this->destinatie)
delete[] this->destinatie;
nrZbor--;
}
// operator <<
friend ostream&operator<<(ostream&iesire, cursaAeriana ca) //
{
iesire << ca.destinatie << endl;
iesire << ca.durataZbor << endl;
return iesire;
}
{
delete[] this->destinatie;
//operator <