• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            C++ 探索之路

            永遠的C++

            常用鏈接

            統(tǒng)計

            最新評論

            C++新標(biāo)準(zhǔn) 編譯器之比較--GCC4.7.0與VS2010

            GCC4.7.0在官網(wǎng)。VS2010是綠色版。在如下地址:
            http://m.shnenglu.com/romangol/archive/2010/05/27/116479.aspx#163998
            程序比較簡陋,測試用。
            G++編譯通過,VS2010未通過編譯。報錯如下:
            D:\VS2010SP1\\include\vadefs.h(48) : error C2144: syntax error : missing ';' before type 'unsigned int'
            D:\VS2010SP1\\include\vadefs.h(48) : fatal error C1004: unexpected end of file found
            代碼如下:
             1 #include <iostream>
             2 #include<vector>
             3 using namespace std;
             4 
             5 class base
             6 {
             7       public:
             8              base(int ii):i(ii){}
             9              int geti(){return i;}
            10       private:
            11               int i;
            12 };
            13 class derived:public base
            14 {
            15       public:
            16              derived(int ii,int jj):base(ii),j(jj){}
            17              int getj(){return j;}
            18       private:
            19               int j;
            20 };
            21 
            22 static vector<base> vecb;
            23 static vector<derived> vecd;
            24 inline void scin(void)
            25 {
            26     int i;
            27      cout<<"請輸入一個數(shù)字:"<<endl;
            28      
            29      for(int j=0;j<3;j++)
            30 {
            31         cin>>i;
            32         vecb.push_back(base(i));
            33 
            34 }
            35       
            36 };
            37 inline void scin1(void)
            38 {
            39     int a,b;
            40      cout<<"請輸入一對數(shù)字:"<<endl;
            41     
            42 for(int j=0;j<3;j++)
            43 {
            44      cin>>a>>b;
            45          vecd.push_back(derived(a,b));
            46 }  
            47       
            48 }
            49 inline void freeitb(void)
            50 {
            51     for(int i=0;i<vecb.size();i++)
            52         vecb.pop_back();
            53 }
            54 inline void freeitd(void)
            55 {
            56     for(int i=0;i<vecd.size();i++)
            57         vecd.pop_back();
            58 }
            59 int main()
            60 {
            61    
            62     vector<base>::iterator itb;
            63     vector<derived>::iterator itd;
            64 scin();
            65 for(itb=vecb.begin();itb!=vecb.end();itb++)
            66 cout<<itb->geti()<<endl;
            67 freeitb();
            68 
            69 scin1();
            70 for(itd=vecd.begin();itd!=vecd.end();itd++)
            71 cout<<itd->geti()<<","<<itd->getj()<<endl;
            72 freeitd();
            73 cin.get();
            74 return 0;
            75 }
            76 
            77 

            posted on 2012-07-01 23:14 AlexEric 閱讀(810) 評論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            人妻丰满?V无码久久不卡| 久久久亚洲裙底偷窥综合| 国产精品99久久精品| 久久久久综合网久久| 伊人久久无码精品中文字幕| 免费精品久久天干天干| 久久99精品国产99久久6男男| 久久精品一区二区影院| 久久亚洲国产成人精品性色| 精品久久久久久无码中文字幕| 久久久久精品国产亚洲AV无码 | 国产福利电影一区二区三区久久久久成人精品综合 | 伊人久久综合无码成人网| 久久国产精品-国产精品| 久久无码AV中文出轨人妻| 四虎国产精品免费久久5151| 国产成人综合久久精品红| 国产精品免费久久| 国产午夜免费高清久久影院 | 久久久久这里只有精品| 久久夜色精品国产噜噜麻豆| 久久亚洲国产成人影院| 精品久久久久久久中文字幕| 精品久久一区二区| 国内精品久久久人妻中文字幕| 亚洲欧洲精品成人久久奇米网| 国产成人精品久久亚洲| 免费精品99久久国产综合精品| 中文字幕乱码久久午夜| 久久中文字幕人妻熟av女| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 久久亚洲sm情趣捆绑调教| 久久人人爽人人爽人人片AV东京热| 久久r热这里有精品视频| 久久91精品国产91久久小草| 韩国免费A级毛片久久| 久久国产精品久久精品国产| 亚洲一本综合久久| 欧洲国产伦久久久久久久| 久久午夜免费视频| 久久国产精品77777|