Contoh Program Stack C++
#include
"iostream"
#include "conio.h"
#define maksElemen
10//konstanta
using namespace std;
struct tumpukan{
short int isi[10];//isi
int pos;//posisi dri stack
};
short int kosong(tumpukan
&t)//periksa bahwa elemen stack kosong
{short int kos;
if(t.pos>0){
kos=0;//blm kosong
cout<
}
else
kos=1;//sudah
};
short int kosong(tumpukan
&t)//periksa bahwa elemen stack kosong
{short int kos;
if(t.pos>0){
kos=0;//blm kosong
cout<
}
else
kos=1;//sudah