//以下是我的源程序
#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)