我的用VS2005编译C++程序时遇到问题 编译时总是弹出下面这个,不知道怎么解决?希望高手指点!谢谢拉(3就是我写的程序)付上代码
#include "stdafx.h"
#include <iostream>
using namespace std;
typedef char SElemType;
typedef int Status;
typedef struct Snode {
SElemType data;
struct Snode *next;
} Snode, *Stackptr;
void InitlinkStack(Stackptr &s)
{ s = NULL; } // InitlinkStack;
Status Push(Stackptr &s, SElemType e)
{
Stackptr p=new Snode;
if(!p) {cout<<"error";return 0;}
p->data=e;p->next=s;
s=p;
return 0;
}
Status Pop(Stackptr &s, SElemType & e)
{
Stackptr p;
if(!s){cout<<"error";return 0;}
e=s->data;
p=s;
s=s->next;
delete p;
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
Stackptr s;
char ch;cin>>ch;
while(ch!='#')
{ Push(s,ch);cin>>ch;}
while(s)
{
Pop(s,ch);
cout<<ch;
}
return 0;
}
[此贴子已经被作者于2006-10-10 21:49:09编辑过]