Professional Documents
Culture Documents
#include <fstream>
#include <algorithm>
#include <vector>
class TStudent
public:
int Age;
Name = name;
Surname = surname;
Age = age;
cout <<"\n";
}
string toString() const
};
class TRegistru
public:
int age;
this->name = other.Name;
this->surname = other.Surname;
this->age = other.Age;
students.push_back(other);
students.push_back(student);
}
void salveaza(string file_name) // crearea fisierului si salvarea datelor
ofstream file1;
file1.open(file_name, ios::app);
file1.write((char*)&students, sizeof(students));
file1.close();
void sterge()
students.clear();
ifstream file2;
file2.open(file_name, ios::in);
if(!file2)
else
file2.seekg(0);
file2.read((char*)&students, sizeof(students));
{
for(auto student : students)
cout <<"\n";
string ret{};
return ret;
};
int main()
TRegistru registru(student1);
registru.adauga(student2);
registru.sterge();
registru.afiseaza();
return 0;