Advertisement
lossyy

asdasdasdas

Apr 17th, 2021
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. #include <vector>
  5.  
  6.  
  7. using namespace std;
  8.  
  9.  
  10. class MyClass {
  11. private:
  12. std::string Lname;
  13. std::string Fname;
  14. int Year;
  15. std::string Prof;
  16. int Group;
  17. fpos_t pos;
  18. public:
  19. MyClass(){
  20. Lname="";
  21. Fname="";
  22. Year=0;
  23. Prof="";
  24. Group=0;
  25.  
  26. ifstream file;
  27. file.open("text.txt");
  28. string str;
  29. while(getline(file, str)){
  30. file >> Lname >> Fname >> Year >> Prof >> Group;
  31. }
  32.  
  33. }
  34. };
  35.  
  36. class DB {
  37. private:
  38.  
  39. public:
  40. void add(MyClass* obj){
  41. db.push_back(obj);
  42. }
  43. vector <MyClass*> db;
  44.  
  45. };
  46.  
  47. int main (){
  48. MyClass a;
  49. a.getText();
  50.  
  51. return 0;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement