/ Published in: C++
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
struct kli_ban{ char ime_prez[25], vrs_tr; int god_ro, st_rc; }; struct re{ kli_ban klijent[5000]; int celo, dno; }; typedef struct kli_ban elem; typedef struct re red; int ADDONE (int x){ return ((x+1)%1000); } bool ISEMPTYQ(re *pok){ if (ADDONE(pok->dno)==pok->celo)return 1; else return 0; } elem FRONTQ(re *pok){ return pok->klijent[pok->celo]; } void ENQUEUEQ(elem a, re *pok){ pok->dno=ADDONE(pok->dno); pok->klijent[pok->dno]=a; } void DEQUEUEQ(re *pok){ pok->celo=ADDONE(pok->celo); } void INITQ(re *pok){ pok->dno=4999; pok->celo=0;}