tehlurk

Header_pokazivac

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