#include <iostream.h>
#include <string.h>
class student{
char *nume;
int varsta, nota;
public:
//constructor clasa
student(char *_nume="anonim", int _varsta=0, int _nota=0):varsta(_varsta),nota(_nota)
{
nume=new char[strlen(_nume)+1];
strcpy(nume,_nume);
}
//constructor de copiere
student(const student &p):varsta(p.varsta),nota(p.nota)
{
nume=new char[strlen(p.nume)+1];
strcpy(nume, p.nume);
}
//destructor
~student()
{
delete nume;
}
//supraincarcare >>
friend istream & operator>>(istream &, student &);
//supraincarcare <<
friend ostream & operator<<(ostream &, student &);
//postincrementare
student operator ++()
{
nota++;
return *this;
Documentul este oferit gratuit,
trebuie doar să te autentifici in contul tău.