Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstring>
- using namespace std;
- struct tdatum{
- int d,m,g;
- };
- struct tpodaci{
- string sifra;
- char vrsta[16];
- char model[16];
- tdatum datum;
- char boja[16];
- float cijena;
- };
- struct st{
- tpodaci podaci;
- st *next;
- };
- typedef st *stack;
- stack stog=new st;
- stack pomocni=new st;
- void InitS(stack S){
- S->next=NULL;
- }
- bool IsEmptyS(stack S){
- if(S==NULL)
- return 1;
- else
- return 0;
- }
- tpodaci TopS(stack S){
- if(IsEmptyS(S)==0)
- return S->podaci;
- }
- void PushS(tpodaci x, stack S){
- st *temp;
- temp=S;
- S=new st;
- S->podaci=x;
- S->next=temp;
- }
- void PopS(stack S){
- st *temp;
- temp=S;
- S=S->next;
- delete temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment