You are on page 1of 2

vector<comanda>listacomenzi;

listacomenzi.push_back(c1);
listacomenzi.push_back(c2);
listacomenzi.insert(listacomenzi.end(), c5);
vector<comanda>::iterator it;
for (it = listacomenzi.begin(); it != listacomenzi.end(); it++)
cout << *it << endl;
==================================================
ofstream fisOut("iesire.txt");
fisOut << c5;
fisOut.close();
ifstream fisIn("intrare.txt");
fisIn >> o4;
cout << o4 << endl;
fisIn.close();
=======================
bool operator<(ospatar &a)
{
if (this->get_nrcomenzi() < a.get_nrcomenzi())
return true; else return false;
}
=================================
comanda operator+(int x)
{
comanda temp = *this;
temp.nrportii = temp.nrportii + x;
return temp;
}
=======================================
comanda operator++()
{
comanda temp = *this;
temp.nrportii++;
return temp;
}
=================================
friend comanda operator++(comanda &c, int)
{
comanda temp = c;
c.nrportii++;
return temp;
}
=====================
void scriebinar(char*numef)
{
ofstream f(numef, ios::binary);
f.write((char*)this, sizeof(*this));
f.close();
}
==================================
this->spectacole = new spectacol[nrspectacole];
for (int i = 0; i < nrspectacole; i++)
this->spectacole[i] = spectacole[i];
================================
ferma operator +=(produs &p1)
{
produs *aux;
this->nrproduse = this->nrproduse + 1;

aux = new produs[this->nrproduse - 1];


for (int i = 0; i < this->nrproduse - 1; i++)
aux[i] = this->produse[i];
delete[]this->produse;
this->produse = new produs[this->nrproduse];
for (int i = 0; i < this->nrproduse - 1; i++)
this->produse[i] = aux[i];
this->produse[this->nrproduse - 1] = p1;
return *this;

You might also like