C++程序调试错误……谢谢您的帮助

//以下是我的源程序

#include <iostream.h>                            //line 1

#define SIZE 100

class stack{
 int stck[SIZE];
 int tos;
public:
 void inits();
 void push(int i);
 int pop(void);
}

stack::inits
{                                                         //line 15
 tos=0;
}

 stack::push
{
 if(i==SIZE) {
  cout<<"堆栈已满";
  return 0 ;
 }
 stck[tos]=i;
 tos++;
}

  stack::pop
{
 if(tos==0){
  cout<<"堆栈溢出!";
  return 0;
 }
 tos--;
 return stck[tos];
}

void main()
{
 stack stack1,stack2;

 stack1.inits ;
 stack2.inits ;

 stack1.push(1);
 stack2.push(2);

 stack1.push(3);
 stack2.push(4);

 cout<<stack1.pop<<" ";
 cout<<stack1.pop<<" ";

 cout<<stack2.pop<<" ";
 cout<<stack2.pop<<" ";

 return 0;
}


以下是出错信息:
--------------------Configuration: exam1 - Win32 Debug--------------------
Compiling...
exam1.cpp
D:/C/exam1.cpp(15) : fatal error C1001: INTERNAL COMPILER ERROR
        (compiler file 'msc1.cpp', line 1786)
         Please choose the Technical Support command on the Visual C++
         Help menu, or open the Technical Support help file for more information
Error executing cl.exe.

exam1.exe - 1 error(s), 0 warning(s)

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值