• <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 閱讀(800) 評論(0)  編輯 收藏 引用

            人妻无码精品久久亚瑟影视| 欧美亚洲国产精品久久久久| 久久亚洲sm情趣捆绑调教| 国产精品成人久久久久三级午夜电影 | 久久久久久综合网天天| 久久青青色综合| 欧美激情精品久久久久久久| 久久性生大片免费观看性| 国产精品免费看久久久香蕉| 热re99久久精品国产99热| 人人狠狠综合久久亚洲88| 香港aa三级久久三级| 久久人人爽人爽人人爽av| 亚洲伊人久久综合中文成人网| 中文字幕精品久久久久人妻| 精品久久久久久国产| 国产精品美女久久久久网| 精品国产一区二区三区久久蜜臀| 久久精品无码免费不卡| 狠狠色丁香久久婷婷综合图片| 97久久婷婷五月综合色d啪蜜芽 | 久久久无码精品亚洲日韩蜜臀浪潮| 久久婷婷五月综合色高清| 国产精品成人久久久久三级午夜电影| 久久福利片| 97久久超碰国产精品2021| 久久男人中文字幕资源站| 日日躁夜夜躁狠狠久久AV| 久久久这里有精品中文字幕| 久久人人爽人人爽人人片AV东京热| 国产91久久精品一区二区| 久久久久人妻一区精品| 国产麻豆精品久久一二三| 中文字幕精品久久| 91精品日韩人妻无码久久不卡| 久久人妻AV中文字幕| 国产99久久久国产精免费| 丁香五月网久久综合| 久久青青草原亚洲av无码app | 国产精品欧美久久久久无广告| 亚洲精品无码久久久久久|