/ Published in: C++

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
struct auti { double ser_br; char proizvodac [20]; char model[20]; int god_pro; }; typedef auti elementtype; struct smth { elementtype vrijednosti[5000]; int vrh; }; typedef struct smth stog; void PushS(elementtype z, stog *L){ if(L->vrh==-1){ cout<<"Doslo je do pogreske!! Stog je pun!!"<<endl; exit(1); }; L->vrijednosti[L->vrh]=z; L->vrh--; }; elementtype TopS(stog *L){ if(L->vrh==4999){ cout<<"Doslo je do pogreske!! Stog je prazan!!"<<endl; exit(1); } return L->vrijednosti[L->vrh+1]; }; int IsEmptyS(stog *L){ if(L->vrh==4999) return 1; else return 0; }; void PopS(stog *L){ if(L->vrh==4999){ cout<<"Doslo je do pogreske!! Stog je prazan!!"<<endl; exit(1); }; L->vrh++; }; stog * InitS(void){ stog *L; L=(stog *)malloc(sizeof(stog)); L->vrh=4999; return L; };
Comments
