tehlurk

Header_polje

Nov 24th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <cstring>
  2. using namespace std;
  3. #define MAXLENGHT 10000
  4.  
  5. struct tdatum{
  6.     int d,m,g;
  7. };
  8. struct tpodaci{
  9.     string sifra;
  10.     char vrsta[16];
  11.     char model[16];
  12.     tdatum datum;
  13.     char boja[16];
  14.     float cijena;
  15. };
  16. struct st{
  17.     tpodaci podaci[MAXLENGHT];
  18.     int top;
  19. }stog,pomocni;
  20.  
  21. typedef st stack;
  22.  
  23. void InitS(stack S){
  24.     S.top=MAXLENGHT;
  25. }
  26. bool IsEmptyS(stack S){
  27.     if(S.top==MAXLENGHT)
  28.         return 1;
  29.     else
  30.         return 0;
  31. }
  32. tpodaci TopS(stack S){
  33.     return S.podaci[S.top];
  34. }
  35. void PushS(tpodaci x, stack S){
  36.     S.top--;
  37.     S.podaci[S.top]=x;
  38. }
  39. void PopS(stack S){
  40.     S.top++;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment