Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <vector>
- using namespace std;
- class MyClass {
- private:
- std::string Lname;
- std::string Fname;
- int Year;
- std::string Prof;
- int Group;
- fpos_t pos;
- public:
- MyClass(){
- Lname="";
- Fname="";
- Year=0;
- Prof="";
- Group=0;
- ifstream file;
- file.open("text.txt");
- string str;
- while(getline(file, str)){
- file >> Lname >> Fname >> Year >> Prof >> Group;
- }
- }
- };
- class DB {
- private:
- public:
- void add(MyClass* obj){
- db.push_back(obj);
- }
- vector <MyClass*> db;
- };
- int main (){
- MyClass a;
- a.getText();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement