Revision: 35931
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at November 15, 2010 08:12 by aldelic
Initial Code
#include <iostream>
using namespace std;
struct elementtype
{
int sbroj;
char proiz[20];
char model[20];
int godina;
};
struct list {
elementtype element;
list *next;
};
struct stack
{
list st;
list *top;
};
void Init(stack *S)
{
S->top = NULL;
S->st.next = NULL;
}
void Push(elementtype x, stack *S)
{
list *newElement = new list;
newElement->next = S->top;
newElement->element = x;
S->top = newElement;
}
elementtype Top(stack *S)
{
return S->top->element;
}
bool IsEmpty(stack *S)
{
if(S->top == NULL)
{
return true;
}
else
{
return false;
}
}
void Pop(stack *S)
{
if(IsEmpty(S))
{
cout << "Stog je prazan." << endl;
}
else
{
delete S->top;
S->top = S->top->next;
}
}
Initial URL
Initial Description
Initial Title
Program automobil stog_pokazivac.h
Initial Tags
Initial Language
C++