【求助】缺少函数头什么意思
#include<iostream>#define SIZE 10
using namespace std;
class CStack
{
private:
int position;
char stk[SIZE];
public:
void init(){position=0;}
char push(char ch);
char pop();
};
char CStack::push(char ch)
{
if (position==SIZE)
{
cout<<" stack is full"<<endl;
return 0;
}
stk[position++]=ch;
return ch;
};
char CStack::pop();
{
if(position==0)
{
cout<<"stack is null"<<endl;
return 0;
}
return str[position--];
};
int main()
{
CStack s;
s.init();
char ch;
while(ch!='!'&&s.push(ch))
cin>>ch;
while(ch=s.pop())
cout<<ch;
return 0;
}
编译时,出现missing function header (old-style formal list?) 是怎么回事???