Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "radnik.hpp"
- #include "lekar.hpp"
- #include "hirurg.hpp"
- using namespace std;
- void predstaviSeA(Radnik rd1){
- rd1.ispis();
- }
- void predstaviSeB(const Radnik &rd1){
- rd1.ispis();
- }
- int main()
- {
- Radnik r1;
- Radnik r2(r1);
- Radnik r3("Dusan","Paripovic","12312321312");
- r3.ispis();
- cout<<"----------------"<<endl;
- Lekar l1;
- Lekar l2(l1);
- Lekar l3("Jelena","Jankovic","2131231312",666);
- l3.ispis();
- cout<<"--------------"<<endl;
- Hirurg h1;
- Hirurg h2(h1);
- Hirurg h3("Jelena","Jankovic","2131231312",666,NEURO);
- h3.ispis();
- cout<<"[Test slobodnih fja]"<<endl;
- cout<<"Predstavi se A"<<endl; //prikazuje samo polja od radnika zato sto objekat nije poslat po referenci
- predstaviSeA(r3);
- cout<<"--------"<<endl;
- predstaviSeA(l3);
- cout<<"--------"<<endl;
- predstaviSeA(h3);
- cout<<"--------"<<endl;
- cout<<"Predstavi se B:"<<endl; // prikazuje sva polja zato sto je objekat poslat po referenci
- predstaviSeB(r3);
- cout<<"--------"<<endl;
- predstaviSeB(l3);
- cout<<"--------"<<endl;
- predstaviSeB(h3);
- cout<<"--------"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement