| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 6948 人关注过本帖
标题:Declaration terminated incorrectly这个错误代码是什么意思呀.
只看楼主 加入收藏
yiming313140172
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-12-14
收藏
 问题点数:0 回复次数:5 
Declaration terminated incorrectly这个错误代码是什么意思呀.
//test 16_5.cpp
//这是一个虚函数示例,我原封不动的写入.结果就是编译不了.系统提示错误在第76行.求各位大侠帮忙!#include <iostream.h>
class caribbean
  {
    public:
    virtual void other_attractions(void)
       {
    cout<<" .........";
       }
  };

class bahamas:public caribbean
  {
    public:
    void other_attractions(void)
      {
     cout........";
      }
  };

class grand_cayman:public caribbean

  {
    public:
    void other_attractions(void)
      {
    cout,,,,,,  };


class st_thomas:public caribbean
 {
 public:
 void other_attractions(void)
   {
     cout<<" ..........
};



  main(void)
    {
      caribbean islands,*ptr;
      bahamas package_1;
      grand_cayman package_2;
      st_thomas package_3;

      ptr=&islands;
      ptr->other_attractions();

      ptr=&package_1;
      ptr->other_attractions();

      ptr=&package_2;
      ptr->other_attractions();

      ptr=&package_3;
      ptr->other_attractions();
      return(0);
                                 // 第76行
                  
     }

*error [color=DarkOrange]16_5.cpp 76 Declaration terminated incorrectly[/color]

[[italic] 本帖最后由 yiming313140172 于 2007-12-15 18:09 编辑 [/italic]]
搜索更多相关主题的帖子: Declaration incorrectly terminated 代码 
2007-12-14 21:28
yiming313140172
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-12-14
收藏
得分:0 
是这样的么
没有人知道么.我真郁闷.都两天了
2007-12-15 19:25
aipb2007
Rank: 8Rank: 8
来 自:CQU
等 级:贵宾
威 望:40
帖 子:2879
专家分:7
注 册:2007-3-18
收藏
得分:0 
代码很不规范,也不标准,你贴的是源代码?

Fight  to win  or  die...
2007-12-15 20:00
mfkpgfsbihc
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2007-11-25
收藏
得分:0 
#include<iostream.h>
class caribbean{
    public:
    virtual void other_attractions(void){
        cout<<" .........";
       }
  };

class bahamas:public caribbean{
 public:
    void other_attractions(void) {
     cout<<"........";
      }
  };

class grand_cayman:public caribbean {
 public:
    void other_attractions(void){
        cout<<",,,,,, " ;}
};
   

class st_thomas:public caribbean{
public:
    void other_attractions(void){
        cout<<" ..........";}
};

main(void)
{
   caribbean islands,*ptr;
   bahamas package_1;
   grand_cayman package_2;
   st_thomas package_3;

   ptr=&islands;
   ptr->other_attractions();

   ptr=&package_1;
   ptr->other_attractions();

   ptr=&package_2;
   ptr->other_attractions();

   ptr=&package_3;
   ptr->other_attractions();
   return(0);
 }

没错啊
2007-12-15 20:10
yiming313140172
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-12-14
收藏
得分:0 
是的
省略号是一些COUT的内容,我没写.
2007-12-16 13:19
lonmaor
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:郑州
等 级:版主
威 望:75
帖 子:2637
专家分:6423
注 册:2007-11-27
收藏
得分:0 
没看内容。
当把
#include<iostream.h>
改成
#include<iostream>
using namespace std;
之后,在DEV C++中调试通过。
2007-12-16 14:40
快速回复:Declaration terminated incorrectly这个错误代码是什么意思呀.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017691 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved