/ Published in: C++
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#include <iostream> using namespace std; struct tautomobil{ int ser_broj; char proizvodac[40]; char model[40]; int god_proizvodnje; }; struct tautomobili{ tautomobil automobil; tautomobili *sljedeci; }; tautomobil TopS(tautomobili *stog){ return stog->sljedeci->automobil; } void PushS(tautomobil element, tautomobili *stog){ tautomobili *sljedeci; sljedeci=new tautomobili; sljedeci->automobil=element; sljedeci->sljedeci=stog->sljedeci; stog->sljedeci=sljedeci; } void PopS(tautomobili *stog){ tautomobili *sljedeci; sljedeci=stog->sljedeci; stog->sljedeci=sljedeci->sljedeci; delete(sljedeci); } void InitS(tautomobili *stog){ stog->sljedeci=NULL; } bool IsEmptyS(tautomobili *stog){ if(stog->sljedeci==NULL) return true; else return false; }