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

王朝c/c++·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

//以下是我的源程序

#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)

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航