新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论高级C/C++编程、代码重构(Refactoring)、极限编程(XP)、泛型编程等话题
    [返回] 中文XML论坛 - 专业的XML技术讨论区计算机技术与应用『 C/C++编程思想 』 → [求助]missing storage-class or type specifiers 能帮我弄一下吗? 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 32219 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [求助]missing storage-class or type specifiers 能帮我弄一下吗? 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     gaoamin 帅哥哟,离线,有人找我吗?
      
      
      等级:大一(高数修炼中)
      文章:24
      积分:148
      门派:XML.ORG.CN
      注册:2007/3/19

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给gaoamin发送一个短消息 把gaoamin加入好友 查看gaoamin的个人资料 搜索gaoamin在『 C/C++编程思想 』的所有贴子 引用回复这个贴子 回复这个贴子 查看gaoamin的博客11
    发贴心情 

    以后,还要大哥我教教我了.

    ----------------------------------------------
    GaoaMin

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/3/23 8:14:00
     
     jerves 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:1
      积分:58
      门派:XML.ORG.CN
      注册:2007/5/30

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jerves发送一个短消息 把jerves加入好友 查看jerves的个人资料 搜索jerves在『 C/C++编程思想 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jerves的博客12
    发贴心情 
    我也是出了同样的问题.可不可以教我怎么做呀?急呀.谢谢啦.
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/5/30 7:42:00
     
     jerves 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:1
      积分:58
      门派:XML.ORG.CN
      注册:2007/5/30

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给jerves发送一个短消息 把jerves加入好友 查看jerves的个人资料 搜索jerves在『 C/C++编程思想 』的所有贴子 引用回复这个贴子 回复这个贴子 查看jerves的博客13
    发贴心情 
    //在h1.h中定义了类Array1D.
    #include "stdafx.h"
    #include "h1.h"
    template<class T>
    class Array2D {
     public:
      Array2D(int r = 0, int c = 0);
      Array2D(const Array2D<T>& m);//copy constructor
      ~Array2D() {delete []row;}
      int Rows() const { return rows;}
      int Columns() const {return cols;}
      Array1D<T>& operator[](int i)const;
      Array2D<T>& operator=(const Array2D<T>& m) const;
      Array2D<T> operator+()const;//unary +
      Array2D<T> operator+(const Array2D<T>& m) const;
      Array2D<T> operator-()const;//unary minus
      Array2D<T> operator-(const Array2D<T>& m) const;
      Array2D<T> operator*(const Array2D<T>& m) const;
      Array2D<T>& operator+=(const T& x);
     private:
      int rows, cols; //number of rows and columns.
      Array1D<T> *row; //array of 1D arrays.
    };


    出现了以下的编译错误:
    :\c++资料与作业\程序\array2d1\h2.h(11) : error C2143: syntax error : missing ';' before '<'
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled
    f:\c++资料与作业\程序\array2d1\h2.h(11) : error C2501: 'Array1D' : missing storage-class or type specifiers
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled
    f:\c++资料与作业\程序\array2d1\h2.h(11) : error C2059: syntax error : '<'
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled
    f:\c++资料与作业\程序\array2d1\h2.h(11) : error C2238: unexpected token(s) preceding ';'
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled
    f:\c++资料与作业\程序\array2d1\h2.h(21) : error C2143: syntax error : missing ';' before '<'
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled
    f:\c++资料与作业\程序\array2d1\h2.h(21) : error C2501: 'Array1D' : missing storage-class or type specifiers
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled
    f:\c++资料与作业\程序\array2d1\h2.h(21) : error C2059: syntax error : '<'
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled
    f:\c++资料与作业\程序\array2d1\h2.h(21) : error C2238: unexpected token(s) preceding ';'
            f:\c++资料与作业\程序\array2d1\h2.h(22) : see reference to class template instantiation 'Array2D<T>' being compiled


    谢谢哪位教我呀.

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/5/30 7:58:00
     
     卷积内核 帅哥哟,离线,有人找我吗?
      
      
      威望:8
      头衔:总统
      等级:博士二年级(版主)
      文章:3942
      积分:27590
      门派:XML.ORG.CN
      注册:2004/7/21

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给卷积内核发送一个短消息 把卷积内核加入好友 查看卷积内核的个人资料 搜索卷积内核在『 C/C++编程思想 』的所有贴子 访问卷积内核的主页 引用回复这个贴子 回复这个贴子 查看卷积内核的博客14
    发贴心情 
    h1.h
    是怎样定义的?
    我随便写的这个没问题啊:
    //h1.h
    #include "stdafx.h"
    template<class T>
    class Array1D {
    private:
      int rows, cols; //number of rows and columns.
    //  Array1D<T> *row; //array of 1D arrays.
    };

    ----------------------------------------------
    事业是国家的,荣誉是单位的,成绩是领导的,工资是老婆的,财产是孩子的,错误是自己的。

    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2007/5/30 9:48:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 C/C++编程思想 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/4/27 14:29:34

    本主题贴数14,分页: [1] [2]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    437.500ms