dragontia/sp-zad2 — Issue #3: pokazivac.h
Author: dragontia
Created: 2011-11-18 13:20:29+00:00
State: open

struct troba{
int sifra, datum, rok;
char naziv[20], vrsta[20];
};

struct stog{
troba roba;
stog *next;
};

troba TopS(stog *S){
return S->next->roba;
};

void PushS(troba x, stog *S){
stog *novi;
novi = new stog;
novi->next = S->next;
novi->roba = x;
S->next = novi;
return;
};

void PopS(stog *S){
stog *novi = S->next;
S->next = novi->next;
delete novi;
};

stog* InitS(stog *S){
S = new stog;
S->next = NULL;
return S;
};

bool IsEmptyS(stog *S){
if (S->next == NULL) return true;
return false;
};