Witam
nie moge skompilować przykładu z książki "Pasja".Program uruchamia się ale zawiesza.Coś nie tak jest z klasą wektor ale nie wiem co....Prosze o pomoc
#include <iostream> #include<string.h> using namespace std; class osoba{ char nazwisko[30]; public: osoba(char*n=NULL) { strcpy(nazwisko,n); } friend ostream&operator<<(ostream&s,const osoba&o); friend ostream&operator<<(ostream&s,const osoba*wsk); }; ostream&operator<<(ostream&s,const osoba&o) { s<<o.nazwisko; return s; } ostream&operator<<(ostream&s,const osoba*wsk) { s<<wsk->nazwisko; return s; } template<class twojtyp> class wektor { twojtyp tabl[15]; int ileobiektow; public: wektor():ileobiektow(0){} int wstaw(const twojtyp&nowy,int gdzie=-1); void usun(int nr); twojtyp&cona(int pozycja){return tabl[pozycja];} friend ostream&operator<<(ostream&stru,wektor<twojtyp>&x); protected: void rozsun(int pozycja); void zsun(int nr); }; template<class twojtyp> void wektor<twojtyp>::rozsun(int pozycja) { for(int i=ileobiektow;i>pozycja;i--) { tabl[i]=tabl[i-1]; } } template<class twojtyp> void wektor<twojtyp>::zsun(int nr) { for(int i=nr;i<ileobiektow;i++) { tabl[i]=tabl[i+1]; } } template<class twojtyp> int wektor<twojtyp>::wstaw(const twojtyp&nowy,int gdzie) { if(ileobiektow==15) { cout<<"Wektor pelny"<<endl; return 0; } if(gdzie<0 || gdzie>ileobiektow) { gdzie=ileobiektow; } rozsun(gdzie); tabl[gdzie]=nowy; ileobiektow++; return 1; } template<class twojtyp> void wektor<twojtyp>::usun(int nr) { if(nr<ileobiektow) { zsun(nr) ; ileobiektow--; } } template<class twojtyp> ostream&operator<<(ostream&stru,wektor<twojtyp> &spis) { stru<<""; for(int i =0;i<spis.ileobiektow;i++) { stru<<i<<") "<<spis.tabl[i]<<""; } stru<<endl; return stru; } int main() { osoba wloch("wloch"), niemiec("niemiec"), austryjak("austryjak"), polak("polak"); cout<<"Wloch: "<<wloch<<endl; wektor<osoba>muzycy; //muzycy.wstaw(wloch); }