其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
C++程序调试错误……谢谢您的帮助

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

//以下是我的源程序

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




相关文章

相关软件