Posted By


epson121 on 11/15/10

Tagged


Statistics


Viewed 510 times
Favorited by 0 user(s)

Related snippets


stog_pokazivaci.h


/ Published in: C++
Save to your folder(s)



Copy this code and paste it in your HTML
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct tautomobil{
  5. int ser_broj;
  6. char proizvodac[40];
  7. char model[40];
  8. int god_proizvodnje;
  9. };
  10.  
  11. struct tautomobili{
  12. tautomobil automobil;
  13. tautomobili *sljedeci;
  14. };
  15.  
  16. tautomobil TopS(tautomobili *stog){
  17. return stog->sljedeci->automobil;
  18. }
  19.  
  20. void PushS(tautomobil element, tautomobili *stog){
  21. tautomobili *sljedeci;
  22. sljedeci=new tautomobili;
  23. sljedeci->automobil=element;
  24. sljedeci->sljedeci=stog->sljedeci;
  25. stog->sljedeci=sljedeci;
  26. }
  27.  
  28. void PopS(tautomobili *stog){
  29. tautomobili *sljedeci;
  30. sljedeci=stog->sljedeci;
  31. stog->sljedeci=sljedeci->sljedeci;
  32. delete(sljedeci);
  33. }
  34.  
  35. void InitS(tautomobili *stog){
  36. stog->sljedeci=NULL;
  37. }
  38.  
  39. bool IsEmptyS(tautomobili *stog){
  40. if(stog->sljedeci==NULL) return true;
  41. else return false;
  42. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.