• <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++

            常用鏈接

            統計

            最新評論

            C++新標準 編譯器之比較--GCC4.7.0與VS2010

            GCC4.7.0在官網。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<<"請輸入一個數字:"<<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<<"請輸入一對數字:"<<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)  編輯 收藏 引用

            亚洲精品成人久久久| 精品熟女少妇AV免费久久| 丁香五月综合久久激情| 久久se精品一区二区影院 | 中文字幕亚洲综合久久2| 四虎国产精品成人免费久久| 久久婷婷五月综合色高清| 精品熟女少妇aⅴ免费久久| 2021最新久久久视精品爱| 99久久精品费精品国产| 99蜜桃臀久久久欧美精品网站 | 伊人久久大香线蕉av不卡| 国产精品成人99久久久久| 伊人久久大香线蕉av不变影院| 久久香蕉综合色一综合色88| 久久久精品国产免大香伊| 久久久久久国产精品无码下载| 久久精品国产亚洲av麻豆色欲 | 亚洲人成无码www久久久 | 久久久国产精华液| 久久青青草原精品国产软件| 久久精品国产秦先生| 久久ww精品w免费人成| 亚洲中文字幕久久精品无码喷水| 久久综合成人网| 欧美久久天天综合香蕉伊| 精品久久人人做人人爽综合 | 四虎国产永久免费久久| 国产午夜精品久久久久免费视| 国产精品中文久久久久久久| 久久久久黑人强伦姧人妻| 精品无码久久久久久久动漫| 欧美综合天天夜夜久久| 国产精品99久久久久久董美香| 国产日产久久高清欧美一区| 99久久免费国产精品热| 99久久无色码中文字幕| 狠狠色丁香婷婷综合久久来来去 | 久久精品国产亚洲Aⅴ香蕉 | 草草久久久无码国产专区| 久久99精品久久久久久秒播|