新微赢技术网
标题:
【求助】缺少函数头什么意思
[打印本页]
作者:
残恋思香
时间:
2009-11-6 01:50
标题:
【求助】缺少函数头什么意思
#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;
}
欢迎光临 新微赢技术网 (http://bbs.weiying.cn/)
Powered by Discuz! X3.2