Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. class Konyv
  2. {
  3. public:
  4.     Konyv(string s, string c, int ev){}
  5.     friend ostream& operator<<(ostream&os, const Konyv&k);
  6.     string toString();
  7.     ~Konyv();
  8.  
  9. private:
  10.     string szerzo;
  11.     string cim;
  12.     int kiadasEve;
  13. };
  14. ostream& operator<<(ostream&os, const Konyv&k) {}
  15. class Kotet:public Konyv
  16. {
  17. public:
  18.     Kotet(string s, string c, int ev,string sorozatCim, int kotetszam){}
  19.     friend ostream& operator<<(ostream&os, const Kotet&k);
  20.     ~Kotet(){}
  21.  
  22. private:
  23.     string sorozatCime;
  24.     int kotetSorszama;
  25.     vector<Konyv*>sorozatreszek;
  26. };
  27. // Konyv a;
  28. Kotet*b=dynamic_cast<Kotet*>(a);
  29. ez a castolás jó?
  30. Meg szeretném állapítani hogy a Kotet-e
  31.  
  32.  
  33. void Konyvtar::add(Konyv*aktkonyv) {
  34.     Kotet*d = dynamic_cast<Kotet*>(aktkonyv);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement