/ Published in: C++

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
struct tauta { int serijski_broj,godina; char proizvodac [40], model[20]; }; typedef tauta element; struct tstog{ element A[1000]; int vrh; }; int b = 1000; typedef struct tstog stog; int IsEmptyS(stog *S){ if(S->vrh == b - 1) return 1; else return 0; }; element TopS(stog *S){ if (!(S->vrh == b-1)) return S->A[S->vrh+1]; else exit(1); }; void PushS(element x, stog *S){ S->A[S->vrh] = x; S->vrh--; }; void PopS(stog *S){ if(!(S->vrh== b-1)) S->vrh++; else return; }; stog *InitS(){ stog *S = new stog; S->vrh = b-1; return S; };
Comments
