#include <iostream>
#include <conio.h>
#include <string.h>
#define MAX 10
using namespace std;
template <class Type>
class stack{
int top;
Type data[MAX];
public :
stack() {top=-1;}
~stack();
int Push(Type what){
if(top<MAX-1){
cout << "empty" << endl;
return -1;
}
top++;
data[top]=what;
return 1;
}
Type pop(){
Type temp;
if(top==-1){
cout << "overflowe" << endl;
}
temp = data[top];
top--;
return temp;
}
bool Isempty(){
if(top==-1) return true;
else
return false;
}
bool Isfull(){
if (top==MAX) return true;
else
return false;
};
void main(){
struct information{
int name;
int lastname;
};
stack <information> st;
information info;
information info1;
info.name=1;
info.lastname=2;
st.Push(info);
info1=st.pop();
cout<< info1.name << info1.lastname << endl;
}
};
error [Linker error] undefined reference to `WinMain@16'
ld returned 1 exit status


Reply With Quote
