dragontia/sp-zad2 — Issue #2: polje.h
Author: dragontia
Created: 2011-11-18 13:20:05+00:00
State: open

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

struct stog {
troba roba[51];
int cursor;
};

troba TopS (stog* S){
return S->roba[S->cursor+1];
};

void PushS (troba x, stog* S){
if(S->cursor>=0) {
S->roba[S->cursor] = x;
S->cursor--;
}
};

void PopS (stog* S) {
S->cursor++;
};

stog* InitS (stog* S) {
S = new stog;
S -> cursor = 49;
return S;
};

bool IsEmptyS (stog* S) {
if (S->cursor == 49) return 1;
return 0;
};