| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> c/c++ >> C++ yu yan feng ge liu bian shi

C++ yu yan feng ge liu bian shi

2008-06-01 02:05:18 编辑來源:互联网 评论
 
 
 
本文为【C++语言风格流变史】的拼音翻译版
  cheng xu dai ma ye you feng ge , zhe suan bu de shen me xin xian shi 。 zao zai 20 shi ji 80 nian dai , C yu yan cheng xu yuan jiu bi xu zai K&R feng ge he ANSI feng ge zhi jian ze shan er cong 。
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  dan ping xin er lun , wo que shi mei you jian guo na yi zhong yu yan neng xiang C++ zhe yang , zai dai ma feng ge fang mian biao xian de ru ci gui jue he nan yi zhuo mo : shui ye shuo bu qing C++ dai ma jiu jing neng yan sheng chu duo shao zhong jiong yi de feng ge , dan wo zhi dao , you xu duo C++ chu xue zhe zai mian dui bu tong feng ge de C++ dai ma shi , jing chang hui wu yi wei zi ji kan dao de shi hao ji zhong wan quan bu tong de bian cheng yu yan —— jin ci yi dian jiu zu yi ti xing wo men , yan jiu he kuo qing C++ yu yan feng ge de yan hua he fa zhan gui lv yi shi dang wu zhi ji le 。 he wen ti xue jia men yan jiu li chao li dai wen ti bian qian de gong zuo xiang fang , yan jiu C++ yu yan feng ge de liu bian shi ye mei you shen me jie jing ke zou 。 wo men zhi neng yi ju liu xie zai 《 wen xin diao long 》 zhong ti chang de “ yuan shi yi biao mo ”[1] de yan jiu fang fa , xun zhe li shi de mai luo , tui qiu dai ma feng ge de lai yuan , tan xun feng ge yan hua de nei yin , bing jie yi chan ming ji shu fa zhan de qu shi he gui lv 。 1. dai lei de C—— dui C yu yan feng ge de yin xi zai 1983 nian 12 yue Bjarne Stroustrup cai na Rick Mascitti de jian yi , jiang qi fa ming de xin yu yan ming ming wei “C++” zhi qian , ren men yi zhi yong “ dai lei de C(C with Classes)” lai cheng hu zhe zhong tuo tai yu C yu yan de , dai you shu ju chou xiang ji zhi de “ fang yan ”。 sui ran dai lei de C zai ben zhi shang jin jin shi yi zhong ke yi bei yu chu li cheng xu CPRe zhuan huan wei chuan tong C yu yan dai ma ( zhe lei si yu wo men zai Oracle zhong jian dao de Pro*C yu yan de yu chu li guo cheng ) de kuo zhan xing yu yan , dan ta de que zai feng ge shang dian ding le hou lai suo you C++ dai ma de ji chu 。class stack {
  char s[SIZE];
  char* min;
  char* top;
  char* max;
  void new();
  public:
  void push(char);
  char pop();
  }; zhe duan “ dai lei de C” dai ma lu zi Stroustrup suo zhu de 《C++ yu yan de she ji he yan hua 》。 dai ma zhong de new() qi shi shi lei stack de gou zao han shu , zhe yu hou lai de C++ yu yan you hen da de bu tong 。 xian er yi jian , dai lei de C zai feng ge shang ji hu wan zheng di cheng xi le C yu yan de yi bo 。 dai ma zhong de sheng ming yu ju kan shang qu yu C yu yan yi mo yi yang ,class de jie gou ye yu C yu yan zhong strUCt de jie gou da zhi xiang fang , zhe xie ji xiang fan yang chu C++ yu yan lai yuan yu C you jin liang yu C bao chi jian rong de she ji si xiang —— zhe zhong she ji si xiang ji wei C++ de xun su pu ji ti gong le bian li (C++ yu yan de shun li tui guang xian ran de yi yu C yu yan yi you de pang da yong hu qun ), ye zai C++ de yu yan feng ge zhong shen shen di luo shang le C yu yan de yin ji , yi zhi yu zai ruo gan nian hou , dang C++ yu yan yi jing ji ben ju bei le “ du li ren ge ” de shi hou ,Stroustrup huan bu de bu shi chang ti xing ren men yao jin liang pao kai C yu yan de si wei fang shi 。 ling yi fang mian ,Stroustrup cong Simula yu yan jie yong de lei 、 pai sheng 、 fang wen kong zhi deng mian xiang dui xiang gai nian zai dai lei de C zhong lao lao di zha xia le gen 。 ju Stroustrup jie shao , ta wei C yu yan yin ru mian xiang dui xiang ji zhi de ben yi zai yu xun zhao yi zhong “ he shi de gong ju ”[2], yi bian shi xian fen bu shi xi tong huo jie jue lei si de fu duo wen ti 。 dan wu lun zen yang ,Stroustrup jiang C de gao xiao he Simula de you ya kun bang zai yi qi de zuo fa dou zai shi shi shang wei C++ yu yan mai xia le “ shuang chong xing ge ” de zhong zi —— hen nan shuo zhe bu shi C++ yu yan feng ge duo yang hua de zhi jie you yin 。2. I/O liu ——C++ de xin xing xiang jia ru shuo C++ yu yan de sheng shen fu mu fen bie shi C yu yan he Simula yu yan de hua , na me ,1984 nian chu xian de , jie zhu cao zuo fu chong zai shi xian de I/O liu ji shu jiu shi C++ zhe ge you tong shuai kai fu mu de bi hu , xiang xin de dai ma feng ge mai chu de di yi bu le 。ostream& Operator<<(ostream&s, const complex& z)
  {
   return s << '(' << z.real()
   << ',' << z.imag() << ')';
  } shang mian ji xing dai ma lai zi Stroustrup suo zhu 《C++ cheng xu she ji yu yan 》 zhong de shi li cheng xu 。 zhu chong na yi xing you “<<” lian jie de dai ma ,I/O liu 、 bian liang 、 zi fu chang liang zai dai ma zhong bei qiao miao di chuan lian zai yi qi 。 cong ji shu jiao du kan , zhe zhong quan xin yu fa de yin ru mi bu le C yu yan zhong printf() han shu zu que fa lei xing an quan ji zhi he kuo zhan neng li de ruo dian 。 cong dai ma feng ge shang shuo ,“<<” deng tong su yi dong de yun suan fu da da gai bian le cheng xu yuan dui C++ yu yan de di yi yin xiang 。 wo zi ji di yi ci jie chu C++ I/O liu ku shi , jiu zeng qing chu di gan jiao dao , yi ge shi tu bai tuo C yu yan feng ge shu fu de C++ jing ling zheng shun zhe “<<” he “>>” zu cheng de xi shui “ liu tang ” er lai —— zhe zhong xing yun liu shui ban de dai ma feng ge zai shi ji nian qian jiu yi jing xian shi chu le C++ yu yan zai su zao xin xing xiang 、 yin jin xin guan nian fang mian de jue xin he yong qi 。
C++语言风格流变史
geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo
  3. OWL he MFC—— chuang kou huan jing xia de feng ge bian yi
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
   20 shi ji 80 nian dai mo dao 90 nian dai chu ,X Window、Mac OS、Windows deng chuang kou huan jing de xian hou chu xian wei cheng xu she ji ti chu le xin de ke ti , er C++ yu yan jian gu mian xiang dui xiang he chuan tong kai fa fang fa de te xing wu yi shi qi cheng wei le chuang kou huan jing xia bian cheng yu yan de zui jia xuan ze 。 yi pi ji yu C++ yu yan de chuang kou kuang jia bu jin zai shang ye shang qu de le cheng gong , ye zai hen da cheng du shang gai bian le C++ yu yan ben shen de feng ge te dian 。 zui zao zai chuang kou kai fa zhong ying de da duo shu cheng xu yuan qing lai de C++ kuang jia shi Borland gong si yu 1992 nian nei zhi zai Borland C++ 3.1 zhong de OWL(Object Windows Library) kuang jia ku 。 xia mian zhe duan dai ma qu zi Borland C++ 3.1 de shi li cheng xu :class TGDIDemoWindow : public TMDIFrame
  
   {
  public:
  TGDIDemoWindow( LPSTR ATitle, LPSTR MenuName )
   : TMDIFrame(ATitle, MenuName) {};
  virtual void SetupWindow();
  virtual void ArtyDemo( TMessage& ) =
   [CM_FIRST + ArtyDemoID];
  virtual void Quit( TMessage& ) =
   [CM_FIRST + QuitID];
  virtual void WMTimer( TMessage& ) =
   [WM_FIRST + WM_TIMER];
  virtual void WMDestroy( TMessage& ) =
   [WM_FIRST + WM_DESTROY];
  }; wei le jie jue chuang kou bian cheng zhong zui yao hai de xiao xi yang she wen ti ,OWL de she ji zhe wei C++ yu yan de cheng yuan han shu yin ru le “=[…]” de gu guai yu fa , zhe shi xu duo yong guo Borland C++ de cheng xu yuan zhi jin dou wu fa wang fu de yi zhong yu yan feng ge 。 wo cheng ren ,Borland gong si zai C++ yu yan de fa zhan chu qi wei wo men ti gong le zui hao de bian yi qi he zui chu se de ji cheng kai fa huan jing (IDE), dan Borland tong guo OWL kuang jia wei C++ yin ru de ling lei yu yan feng ge de que rang ren bu gan gong wei ( ke guan di jiang , zhe bi zhang ye bu ying quan suan zai Borland tou shang , yin wei OWL de qian shen shi Borland cong White Water gong si gou mai de kuang jia dai ma )。 jiu zai Borland C++ 3.1 tong zhi shi chang liang nian yi hou ,Microsoft ping jie qi dang ren bu rang de ba qi he wen ming de Visual C++ xi lie chan pin zhu jian duo hui le Windows kai fa gong ju shi chang de zhu dao quan 。 yu Borland bu tong de shi ,Visual C++ zhong de MFC(Microsoft Foundation Class) kuang jia ku mei you xiang OWL na yang si yi cuan gai C++ de yu fa , er shi cai yong le xia mian zhe yang de fang shi lai shi xian xiao xi yang she ( dai ma qu zi MSDN shi li cheng xu ):// Example for BEGIN_MESSAGE_MAP
  BEGIN_MESSAGE_MAP( CMyWindow, CFrameWnd )
   ON_WM_PAINT()
   ON_COMMAND( IDM_ABOUT, OnAbout )
  END_MESSAGE_MAP( ) shi shi shang , yong MFC kuang jia bian xie de C++ dai ma zai da liang shi yong hong ding yi deng yu bian yi zhi ling de tong shi , huan ba WIN32 ping tai xia chang jian de xiong ya li feng ge ( you guan biao shi fu da xiao xie he qian zhui de shu xie gui fan ) fa hui dao le ji xian 。 zhe yi dian yong bu zhe wo duo fei kou she , xu duo cheng xu yuan jin cong dai ma de da xiao xie te zheng shang jiu neng bai fen zhi bai di que ding dai ma zhong shi fou shi yong le MFC kuang jia 。 hen yi han ,MFC wei C++ da zao de yu yan feng ge bing mei you de dao C++ zhuan jia men de shou ken 。 li ru , bao kuo Stroustrup zai nei de xu duo xue zhe dou jian yi wo men jin liang shao yong shen zhi bu yong hong ding yi deng yu chu li zhi ling 。 zai zhe yi dian shang ,MFC de zuo fa xian ran he zhuan jia men de lun tiao bei dao er chi 。 ying dang shuo , shi Microsoft de ba qi zao jiu le MFC de ju da cheng gong ; dan cong chun cui de yu yan xue jiao du kan ,MFC zai yu yan feng ge shang de gong xian yuan bu ru ta zai chuang kou kuang jia ji shu fang mian de gong xian da 。4. mo ban —— xian dai C++ feng ge de ji chu Stroustrup yu 1988 nian shou ci gong bu le yu mo ban (template) you guan de yu fa she ji 。 hao wu yi wen , zhe shi yi xiang dui xian dai C++ de yu yan feng ge ying xiang zui da de ji shu gai jin 。 mo ban de gai nian lai zi Clu yu yan , bing zong he le Smalltalk he Ada yu yan zhong xiang guan ji shu de you dian 。1991 nian hou , bao han mo ban ji zhi de kai fa huan jing (DEC C++、IBM C++、Borland C++ deng ) lu xu wen shi 。 dan zhi dao 1995 nian STL(Standard Template Library) mo ban ku zhu jian fa zhan cheng shu yi hou , mo ban ji shu cai zai cheng xu yuan zhong xun su pu ji kai lai 。 xia mian de li zi qu zi SGI STL de shi li dai ma , ta ji ben fan yang le shi yong mo ban ji shu hou C++ dai ma de zheng ti feng ge :template <class InputIterator, class T>
  InputIterator find(InputIterator first,
   InputIterator last, const T& value)
  {
   while (first != last && *first != value)
   ++first;
   return first;
  } zai zhe yang de C++ dai ma zhong , chu le shao shu ji ge yao hai zi he cao zuo fu yi wai , wo men ji hu zhao bu dao duo shao C yu yan de hen ji le 。 mo ban ji shu jian gu le lei xing an quan he bian ma ling huo xing de shuang chong xu qiu , dan ta tong shi ye wei C++ yu yan yin ru le yi zhong geng jia jing miao dan ye jiao nan li jie ( xiang dui yu mei you mo ban de dai ma er yan ) de dai ma feng ge 。 xu duo chuan tong de C yu yan yong hu zhe tao yan zhe zhong feng ge de dai ma , dan geng duo de xin sheng dai cheng xu yuan dui qi zhong ai you jia 。1998 nian , zai ANSI/ISO biao zhun hua wei yuan hui de zhi chi xia ,STL bei zuo wei biao zhun C++ ku (Standard C++ Library) de yi bu fen shou ru le C++ guo ji biao zhun zhi zhong 。 jin tian , yi mo ban 、 yi chang deng xian dai C++ ji shu wei dai biao de yu yan feng ge ye yi zai shi shi shang cheng wei le C++ shi jie de “ guan fang feng ge ”。
C++语言风格流变史
geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo
  5. ATL——COM shi dai de ling lei C++ chu le STL mo ban ku zhi wai , huan you yi ge yu mo ban feng ge xiang guan de li zi 。 xia mian de dai ma pian duan qu zi Visual C++ zi dong sheng cheng de ATL kong jian gong cheng :
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  class ATL_NO_VTABLE CMyATLObj :
  
   public IMyATLObj,
   public ipersistStreamInitImpl
   <CMyATLObj>,
   public IOleControlImpl<CMyATLObj>,
   public IOleObjectImpl<CMyATLObj>,
   public IoleInPlaceActiveObjectImpl
   <CMyATLObj>,
   public IViewObjectExImpl<CMyATLObj>,
   public IoleInPlaceObjectWindowlessImpl
   <CMyATLObj>,
   public IPersistStorageImpl<CMyATLObj>,
   public IspecifyPropertyPagesImpl
   <CMyATLObj>,
   public IQuickActivateImpl<CMyATLObj>,
   public IDataObjectImpl<CMyATLObj>,
   public IProvideClassInfo2Impl
   <&__uuidof(CMyATLObj), NULL>,
   public CComControl<CMyATLObj>
  ...... zhu chong kong jian lei CMyATLObj de dai ma ,CMyATLObj lei ju ran shi cong N ge jie kou lei he kong jian lei zhong pai sheng chu lai de , lei de sheng ming yu ju zhong sui chu ke jian mo ban de shen ying —— zhe jiu shi Microsoft wei wo men she ji de bie ju yi ge de ATL feng ge de dai ma le 。 zhi suo yi yao bu xi dai jia di da liang shi yong mo ban 、 duo chong ji xu deng yu yan te xing , zhe zhu yao wei le shi ying COM、OLE、ActiveX deng zai jia gou shang ben lai jiu xiang dui fu duo de ji shu ti xi 。 dan zhe yang yi lai , shi yong ATL de dai ma zai suo you C++ dai ma zhong , jiu yong you le yi fu yi hu ping chang de chang xiang le : dao chu dou shi jian kuo hao , dao chu dou shi yi “I” da tou de biao shi fu , shen zhi huan you duo chong jian kuo hao de qian tao …… jia ru yao qiu yi ge gang xue hui C++ yu yan de cheng xu yuan ma shang du dong yi da duan ATL dai ma , wo xiang , yong bu le ji fen zhong , ta jiu hui bei dai ma zhong na xie hui se 、 li qi de yu yan feng ge zhe mo de jing shen beng kui le 。6. biao zhun C++—— yi zhong quan xin de yu yan ? C++ yu yan de biao zhun hua jin cheng yuan yuan luo hou yu yu yan ben shen de pu ji su du 。1990 nian yi hou ,ANSI/ISO de C++ biao zhun hua wei yuan hui cai jiang bao kuo Stroustrup zai nei de da pi zhuan jia yi ji bao kuo Apple、Borland、DEC、HP、IBM、Microsoft、Sun、Unisys zai nei de zhi ming gong si zhao ji zai yi qi , xiang suo you guo jia de yi hui huo ren min dai biao da hui yi yang tong guo mei wan mei le de hui yi 、 tao lun he tou piao zhi ding C++ de guo ji biao zhun 。 biao zhun zhi dao 1998 nian 9 yue cai zheng shi fa bu 。 zai guo ji biao zhun hua zu zhi de dang an ku li ,C++ biao zhun de dai hao shi ISO/IEC 14882:1998。 Stroustrup jian yi wo men ba biao zhun C++ dang zuo yi zhong quan xin de yu yan lai xue xi [3]。 zhe yi shuo fa xian ran shi ji yu zhe yang yi ge shi shi : biao zhun C++ yu yan yi jing yong you le yi zhong wen ding de 、 ke yi tui guang de yu yan feng ge , ji , tong guo dui STL deng ji you ji shu de ken ding ,ANSI/ISO wei yuan hui zai 1998 nian de biao zhun zhong zheng shi ren ke le bao kuo mo ban 、 rong qi lei 、I/O liu ku 、 yi chang chu li deng dian xing yu yan te zheng de xian dai C++ feng ge 。 feng ge de wen ding yi wei zhe yu yan ben shen de jin bu he cheng shu , ye yi wei zhe cheng xu yuan men dui C++ de shu xi bi xu shang sheng dao yi ge xin de ceng ci —— na xie zhi jin huan zai bian xie jin you lei he C yu yan ku han shu zu cheng de C++ dai ma de cheng xu yuan , yi ding hui cheng wei Stroustrup ji qi tong ren men de qu xiao dui xiang de 。 Stroustrup de 《C++ cheng xu she ji yu yan 》 di 3 ban dui biao zhun C++ feng ge zuo le zui quan wei de chan shi 。 zai Stroustrup deng zhuan jia xue zhe de hao zhao xia , yue lai yue duo de xiang mu kai shi bian xie fu he biao zhun C++ feng ge de dai ma 。 zhe yi dian zai xu duo kai fang yuan dai ma de xiang mu zhong ti xian de fei fan ming xian 。 zhe duo ban shi you yu , shi yong C++ yu yan de kai yuan xiang mu da duo dou bu hui xiang da qi ye li de xiang mu zu na yang , zai yu yan feng ge shang hui shou dao gong si bei jing huo li shi xi guan de ji ban 。 zai ju ti de bian cheng shi jian zhong , kai yuan xiang mu de cheng xu yuan men yi fang mian ke yi guo duan di guan che biao zhun C++ de yu yan feng ge , ling yi fang mian ye ke yi gen ju zi ji de xi hao wei dai ma zeng tian yi xie gan qing se cai 。 li ru , zai OpenOffice de yuan ma zhong , biao shi fu de qian zhui gui fan jiu xiang dang you te dian , lian zhi zhen he yin yong lei xing de bian liang dou you bu tong de qian zhui zi mu qu fen ; xia mian gei chu de linux zhuo mian zhi li qi KDE 3.1.4 de yuan dai ma pian duan ze xian shi chu , kai fa KDE de cheng xu yuan zai dai ma feng ge shang huo duo huo shao shou dao le java yu yan feng ge de ying xiang :class delUser: public KDialogBase {
  Q_OBJECT
  public:
  delUser(KUser *AUser, QWidget *parent = 0,
   const char *name = 0);
  bool getDeleteHomeDir()
   { return m_deleteHomeDir->isChecked(); }
  bool getDeleteMailBox()
  
   { return m_deleteMailBox->isChecked(); }
  private:
  QCheckBox *m_deleteHomeDir;
  QCheckBox *m_deleteMailBox;
  };
C++语言风格流变史
geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo
  7. du bu dong de dai ma —— jian rong bing bao de yu yan feng ge shuo dao biao zhun C++ yu yan feng ge , you bi yao gei da jia kan yi duan fei chang gu guai dan ye fei chang you qu de dai ma 。 ni kan de dong xia mian zhe duan C++ dai ma ma ? ta shi zhen zheng de C++ dai ma ma ?
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  %:include <iostream>
  using namespace std;
  %:define MAX 5
  void main()
  <%
   int m<:MAX:>;
   int i = 1;
   for (i = 0; i < MAX; i++)
   <%
   m<:i:> = i;
   if (i not_eq 3 and i < 5)
   cout << i << endl;
   %>
  %> zhe shi wo zi ji bian xie de yi duan dai ma 。 ni ye xu wu fa zai Visual C++ huan jing xia yun xing ta , dan ta de yu fa de que fu he 1998 nian C++ biao zhun de gui ding 。 zai GNU C++ huan jing xia , wo zeng cheng gong di jiang qi bian yi wei ke zhi xing cheng xu 。 jian dan shuo lai , zhe duan feng ge gui yi de C++ dai ma qi shi shi gen ju C++ biao zhun zhong guan yu ke ti huan biao ji (Alternative Tokens) de gui ding er bian xie de 。 gai gui ding de she ji chu zhong shi yao shi ying ou zhou mou xie guo jia de biao zhun zi fu ji que shao “{”、“#” deng biao dian fu hao ( fei fan shi zai yi xie chuan tong de zhong duan she bei shang ) de xian zhuang 。 yan ge di jiang , zhe suan bu de yi zhong zhen zheng de yu yan feng ge , dan lei si de gui ding de que ti xian le ANSI/ISO wei yuan hui zai yu yan she ji shang jian rong bing bao de kuan guang xiong jin 。 8. C++Builder——Borland de fu xing zhi lu Borland gong si zai fa bu le Borland C++ 3.1 zhi hou , jiu yin wei bu si jin qu er jiang C++ kai fa gong ju de shi chang gong shou rang gei le Microsoft[4]。 zai jing li le Borland C++ 4.0、4.5 he 5.0 deng ban ben de shi bai hou ,1997 nian ,Borland tui chu le quan xin de C++ kai fa gong ju C++Builder。 zhe ge zai shi chang shang wei Borland wan hui le yan mian de chan pin bu dan zai jie mian feng ge shang yu Borland de zhi zhu chan pin Delphi bie wu er zhi , shen zhi huan zai chan pin nei bu zhi jie zhao ban le Delphi de VCL(Visual Component Library) ku 。 jie guo , shi yong C++Builder kai fa de dai ma tian sheng jiu shou dao le Delphi feng ge de chuan ran , chang xiang ku si Pascal yu yan le ( yi xia dai ma qu zi C++Builder 6.0 de shi li dai ma ):class TFormClrDlg : public TForm
  {
  published: // IDE-managed Components
   TColorDialog *ColorDialog;
   TButton *Button;
   TPanel *Panel1;
   void fastcall ButtonClick(TObject *Sender);
  private: // User declarations
  public: // User declarations
   virtual fastcall TFormClrDlg(TComponent* Owner);
  }; shuo shi hua , jin guan C++Builder zai shi chang shang de biao xian bu cuo , dan wo huan shi bu xi huan Borland jiang C++ yu yan yu Delphi zhong de Object Pascal yu yan ke yi hun xiao de zuo fa 。 ye xu zai Borland zhe zhong zuo fa de bei hou you ti gao chan pin tong yong xing 、 suo duan chan pin kai fa zhou qi deng ti mian de li you , dan shi yong C++Builder kai fa chu de dai ma zai wai biao shang yi jing li biao zhun C++ feng ge yue lai yue yuan le 。 zhi de zhu chong de shi ,Borland yu 2003 nian tui chu le qi xia yi dai C++ kai fa gong ju ——C++BuilderX。 rang ren ku xiao bu de de shi , zhe yi ci Borland ju ran jiang C++ kai fa huan jing gou zhu zai le yong Java yu yan shi xian de PrimeTime ping tai shang , zhe duo shao jiang C++ yu yan tui xiang le yi zhong ji wei gan ga de chu jing 。 bu guo ,C++BuilderX ye wei wo men dai lai le yi xie hao xiao xi : zai hou xu de ban ben zhong ,C++BuilderX jiang ji cheng vxWindows kuang jia ku [5], zai zhe zhong kuang jia xia kai fa de C++ dai ma xian ran yao bi shi yong VCL de dai ma ju bei geng duo de biao zhun C++ feng ge 。9. Visual C++ .NET—— ge ming huan shi pan ni ? Microsoft jiang C++ yin ru .NET huan jing de ju dong qi shi bi Borland huan yao ji jin 。 dan cong feng ge shang shuo , shi yong Visual C++ .NET kai fa de dai ma ke neng jian ju MFC、ATL、 biao zhun C++、.NET tuo guan dai ma deng duo zhong bu tong de feng ge 。 qi zhong , dui C++ yu yan ben shen ying xiang zui da de , dang ran yao shu .NET tuo guan dai ma wei C++ zhu ru de ruo gan xin xian xue ye le :#using <mscorlib.dll>
  
  
  using namespace System;
  using namespace System::Reflection;
  using namespace System::Security::Permissions;
  public __value enum SomeStuff {
   e1 = 1,
   e17 = 17
  };
  [attribute(AttributeTargets::Class, AllowMultiple=true)]
  public __gc class ABC {
  public:
   ABC(int __gc[]) {}
   ABC() {}
   ABC(int) {}
   ABC(int, float) {}
   ABC(SomeStuff) {}
   ABC(String*) {}
   int rgnField __gc [];
   double rgdField __gc [];
   double dField;
  }; shang shu dai ma lai zi MSDN zhong de shi li cheng xu 。 kan dao Microsoft da dao kuo fu di wei C++ yu yan yin ru de la ji shou ji 、Attribute shu xing deng xin te xing he xin ji shu , kan dao .NET tuo guan dai ma xin qi de jin hu li jing pan dao de yu yan feng ge , wo bu zhi dao shi ying gai wei Microsoft zai fa zhan tong yong yu yan ping tai shang de nu li er huan hu que yue , huan shi ying gai wei C++ zai C# yu yan yin ying xia ri jian qu ju .NET da xi zhong de pei jiao er hui xin sang qi 。 ye xu , yu yan feng ge he cheng xu yuan de gan shou zai Microsoft yan zhong , dou shi xie bu zhi yi ti de xiao shi , ta men na neng he .NET de hong wei zhan lue ji Microsoft de qiang da di guo xiang ti bing lun ne ?10. hui gu he zhan wang yu yan feng ge de bian qian cong yi ge ce mian fan yang le ji shu si xiang he chan ye xu qiu de chan bian gui lv 。 cong 1979 nian Stroustrup wan cheng di yi ge Cpre yu chu li cheng xu suan qi ,C++ yu yan lai dao zhe ge shi jie shang yi jing kuai man 25 ge nian tou le 。 zhe shi yi zhong zai shi jian zhong dan sheng 、 cheng chang he fa zhan qi lai de yu yan 。 ye xu ,Stroustrup cong yi kai shi jiu ya gen er ye mei xiang ba ta she ji cheng xiang Smalltalk na yang chun cui de mian xiang dui xiang yu yan 。 kai fang xing 、 gao xiao lv 、 jian rong xing he kuo zhan xing de xu qiu jiang C++ yu yan su zao cheng le yi zhong dian xing de duo mo shi (Multiparadigm) yu yan 。 wu lun shi C++ zao qi dui Simula yu yan de ji xu , huan shi hou lai dui Smalltalk、Ada、Clu deng yu yan de jie jian , wu lun shi ANSI/ISO biao zhun feng ge de xun su pu ji , huan shi Visual C++ .NET zai ji shu chuang xin shang de bu xie nu li , suo you zhe xie li shi bian qian dou shuo ming ,C++ zai feng ge shang de duo yang xing zhu yao yuan zi C++ yu yan ben shen “ hai na bai chuan ” de xiong jin he qi gai 。 5 nian yi hou , dang C++ bu ru er li zhi nian de shi hou , ta hui gei wo men dai lai xin de jing xi ma ? wo men huan hui kan dao geng jia xin qi de C++ yu yan feng ge ma ? ye xu , mei you shui neng gei chu zhun que de da an 。 dan zuo wei cheng xu yuan , wo men zhi shao ying gai zhi dao : wu lun mian dui shen me yang de ruan jian xu qiu , wu lun shi yong shen me yang de si wei fang shi ,C++ yu yan dou fu yu le wo men xuan ze yu yan feng ge de zui da zi you ; dang wo men zhen zheng li jie le C++ yu yan de jing shen shi zhi zhi hou , zhe zhong zi you ye bi jiang cheng wei suo you you xiu ruan jian he you ya dai ma de jian shi ji chu 。 shen kao wen xian [1] liu xie . wen xin diao long · xu zhi .
  [2] Stroustrup B. C++ yu yan de she ji he yan hua . bei jing : ji xie gong ye chu ban she , 2002
  [3] Stroustrup B. Learning Standard C++ as a New Language. C/C++ Users Journal. pp 43-54. May 1999.
  [4] li wei . Borland chuan qi . bei jing : dian zi gong ye chu ban she , 2003
  [5] li wei . xi shuo Borland C++BuilderX. cheng xu yuan . 2003.11
C++语言风格流变史
geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
cheng xu dai ma ye you feng ge , zhe suan bu de shen me xin xian shi 。 zao zai 20 shi ji 80 nian dai , C yu yan cheng xu yuan jiu bi xu zai K&R feng ge he ANSI feng ge zhi jian ze shan er cong 。 dan ping xin er lun , wo que shi mei you jian guo na yi zhong yu yan neng xiang C++ zhe yang , zai dai ma feng ge fang mian biao xian de ru ci gui jue he nan yi zhuo mo : shui ye shuo bu qing C++ dai ma jiu jing neng yan sheng chu duo shao zhong jiong yi de feng ge , dan wo zhi dao , you xu duo C++ chu xue zhe zai mian dui bu tong feng ge de C++ dai ma shi , jing chang hui wu yi wei zi ji kan dao de shi hao ji zhong wan quan bu tong de bian cheng yu yan —— jin ci yi dian jiu zu yi ti xing wo men , yan jiu he kuo qing C++ yu yan feng ge de yan hua he fa zhan gui lv yi shi dang wu zhi ji le 。 he wen ti xue jia men yan jiu li chao li dai wen ti bian qian de gong zuo xiang fang , yan jiu C++ yu yan feng ge de liu bian shi ye mei you shen me jie jing ke zou 。 wo men zhi neng yi ju liu xie zai 《 wen xin diao long 》 zhong ti chang de “ yuan shi yi biao mo ”[1] de yan jiu fang fa , xun zhe li shi de mai luo , tui qiu dai ma feng ge de lai yuan , tan xun feng ge yan hua de nei yin , bing jie yi chan ming ji shu fa zhan de qu shi he gui lv 。 1. dai lei de C—— dui C yu yan feng ge de yin xi zai 1983 nian 12 yue Bjarne Stroustrup cai na Rick Mascitti de jian yi , jiang qi fa ming de xin yu yan ming ming wei “C++” zhi qian , ren men yi zhi yong “ dai lei de C(C with Classes)” lai cheng hu zhe zhong tuo tai yu C yu yan de , dai you shu ju chou xiang ji zhi de “ fang yan ”。 sui ran dai lei de C zai ben zhi shang jin jin shi yi zhong ke yi bei yu chu li cheng xu CPRe zhuan huan wei chuan tong C yu yan dai ma ( zhe lei si yu wo men zai Oracle zhong jian dao de Pro*C yu yan de yu chu li guo cheng ) de kuo zhan xing yu yan , dan ta de que zai feng ge shang dian ding le hou lai suo you C++ dai ma de ji chu 。class stack { char s[SIZE]; char* min; char* top; char* max; void new(); public: void push(char); char pop(); }; zhe duan “ dai lei de C” dai ma lu zi Stroustrup suo zhu de 《C++ yu yan de she ji he yan hua 》。 dai ma zhong de new() qi shi shi lei stack de gou zao han shu , zhe yu hou lai de C++ yu yan you hen da de bu tong 。 xian er yi jian , dai lei de C zai feng ge shang ji hu wan zheng di cheng xi le C yu yan de yi bo 。 dai ma zhong de sheng ming yu ju kan shang qu yu C yu yan yi mo yi yang ,class de jie gou ye yu C yu yan zhong strUCt de jie gou da zhi xiang fang , zhe xie ji xiang fan yang chu C++ yu yan lai yuan yu C you jin liang yu C bao chi jian rong de she ji si xiang —— zhe zhong she ji si xiang ji wei C++ de xun su pu ji ti gong le bian li (C++ yu yan de shun li tui guang xian ran de yi yu C yu yan yi you de pang da yong hu qun ), ye zai C++ de yu yan feng ge zhong shen shen di luo shang le C yu yan de yin ji , yi zhi yu zai ruo gan nian hou , dang C++ yu yan yi jing ji ben ju bei le “ du li ren ge ” de shi hou ,Stroustrup huan bu de bu shi chang ti xing ren men yao jin liang pao kai C yu yan de si wei fang shi 。 ling yi fang mian ,Stroustrup cong Simula yu yan jie yong de lei 、 pai sheng 、 fang wen kong zhi deng mian xiang dui xiang gai nian zai dai lei de C zhong lao lao di zha xia le gen 。 ju Stroustrup jie shao , ta wei C yu yan yin ru mian xiang dui xiang ji zhi de ben yi zai yu xun zhao yi zhong “ he shi de gong ju ”[2], yi bian shi xian fen bu shi xi tong huo jie jue lei si de fu duo wen ti 。 dan wu lun zen yang ,Stroustrup jiang C de gao xiao he Simula de you ya kun bang zai yi qi de zuo fa dou zai shi shi shang wei C++ yu yan mai xia le “ shuang chong xing ge ” de zhong zi —— hen nan shuo zhe bu shi C++ yu yan feng ge duo yang hua de zhi jie you yin 。2. I/O liu ——C++ de xin xing xiang jia ru shuo C++ yu yan de sheng shen fu mu fen bie shi C yu yan he Simula yu yan de hua , na me ,1984 nian chu xian de , jie zhu cao zuo fu chong zai shi xian de I/O liu ji shu jiu shi C++ zhe ge you tong shuai kai fu mu de bi hu , xiang xin de dai ma feng ge mai chu de di yi bu le 。ostream& Operator<<(ostream&s, const complex& z) { return s << '(' << z.real() << ',' << z.imag() << ')'; } shang mian ji xing dai ma lai zi Stroustrup suo zhu 《C++ cheng xu she ji yu yan 》 zhong de shi li cheng xu 。 zhu chong na yi xing you “<<” lian jie de dai ma ,I/O liu 、 bian liang 、 zi fu chang liang zai dai ma zhong bei qiao miao di chuan lian zai yi qi 。 cong ji shu jiao du kan , zhe zhong quan xin yu fa de yin ru mi bu le C yu yan zhong printf() han shu zu que fa lei xing an quan ji zhi he kuo zhan neng li de ruo dian 。 cong dai ma feng ge shang shuo ,“<<” deng tong su yi dong de yun suan fu da da gai bian le cheng xu yuan dui C++ yu yan de di yi yin xiang 。 wo zi ji di yi ci jie chu C++ I/O liu ku shi , jiu zeng qing chu di gan jiao dao , yi ge shi tu bai tuo C yu yan feng ge shu fu de C++ jing ling zheng shun zhe “<<” he “>>” zu cheng de xi shui “ liu tang ” er lai —— zhe zhong xing yun liu shui ban de dai ma feng ge zai shi ji nian qian jiu yi jing xian shi chu le C++ yu yan zai su zao xin xing xiang 、 yin jin xin guan nian fang mian de jue xin he yong qi 。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785346.html][img]http://image.wangchao.net.cn/it/1323423819752.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo 3. OWL he MFC—— chuang kou huan jing xia de feng ge bian yi 20 shi ji 80 nian dai mo dao 90 nian dai chu ,X Window、Mac OS、Windows deng chuang kou huan jing de xian hou chu xian wei cheng xu she ji ti chu le xin de ke ti , er C++ yu yan jian gu mian xiang dui xiang he chuan tong kai fa fang fa de te xing wu yi shi qi cheng wei le chuang kou huan jing xia bian cheng yu yan de zui jia xuan ze 。 yi pi ji yu C++ yu yan de chuang kou kuang jia bu jin zai shang ye shang qu de le cheng gong , ye zai hen da cheng du shang gai bian le C++ yu yan ben shen de feng ge te dian 。 zui zao zai chuang kou kai fa zhong ying de da duo shu cheng xu yuan qing lai de C++ kuang jia shi Borland gong si yu 1992 nian nei zhi zai Borland C++ 3.1 zhong de OWL(Object Windows Library) kuang jia ku 。 xia mian zhe duan dai ma qu zi Borland C++ 3.1 de shi li cheng xu :class TGDIDemoWindow : public TMDIFrame { public: TGDIDemoWindow( LPSTR ATitle, LPSTR MenuName ) : TMDIFrame(ATitle, MenuName) {}; virtual void SetupWindow(); virtual void ArtyDemo( TMessage& ) = [CM_FIRST + ArtyDemoID]; virtual void Quit( TMessage& ) = [CM_FIRST + QuitID]; virtual void WMTimer( TMessage& ) = [WM_FIRST + WM_TIMER]; virtual void WMDestroy( TMessage& ) = [WM_FIRST + WM_DESTROY]; }; wei le jie jue chuang kou bian cheng zhong zui yao hai de xiao xi yang she wen ti ,OWL de she ji zhe wei C++ yu yan de cheng yuan han shu yin ru le “=[…]” de gu guai yu fa , zhe shi xu duo yong guo Borland C++ de cheng xu yuan zhi jin dou wu fa wang fu de yi zhong yu yan feng ge 。 wo cheng ren ,Borland gong si zai C++ yu yan de fa zhan chu qi wei wo men ti gong le zui hao de bian yi qi he zui chu se de ji cheng kai fa huan jing (IDE), dan Borland tong guo OWL kuang jia wei C++ yin ru de ling lei yu yan feng ge de que rang ren bu gan gong wei ( ke guan di jiang , zhe bi zhang ye bu ying quan suan zai Borland tou shang , yin wei OWL de qian shen shi Borland cong White Water gong si gou mai de kuang jia dai ma )。 jiu zai Borland C++ 3.1 tong zhi shi chang liang nian yi hou ,Microsoft ping jie qi dang ren bu rang de ba qi he wen ming de Visual C++ xi lie chan pin zhu jian duo hui le Windows kai fa gong ju shi chang de zhu dao quan 。 yu Borland bu tong de shi ,Visual C++ zhong de MFC(Microsoft Foundation Class) kuang jia ku mei you xiang OWL na yang si yi cuan gai C++ de yu fa , er shi cai yong le xia mian zhe yang de fang shi lai shi xian xiao xi yang she ( dai ma qu zi MSDN shi li cheng xu ):// Example for BEGIN_MESSAGE_MAP BEGIN_MESSAGE_MAP( CMyWindow, CFrameWnd ) ON_WM_PAINT() ON_COMMAND( IDM_ABOUT, OnAbout ) END_MESSAGE_MAP( ) shi shi shang , yong MFC kuang jia bian xie de C++ dai ma zai da liang shi yong hong ding yi deng yu bian yi zhi ling de tong shi , huan ba WIN32 ping tai xia chang jian de xiong ya li feng ge ( you guan biao shi fu da xiao xie he qian zhui de shu xie gui fan ) fa hui dao le ji xian 。 zhe yi dian yong bu zhe wo duo fei kou she , xu duo cheng xu yuan jin cong dai ma de da xiao xie te zheng shang jiu neng bai fen zhi bai di que ding dai ma zhong shi fou shi yong le MFC kuang jia 。 hen yi han ,MFC wei C++ da zao de yu yan feng ge bing mei you de dao C++ zhuan jia men de shou ken 。 li ru , bao kuo Stroustrup zai nei de xu duo xue zhe dou jian yi wo men jin liang shao yong shen zhi bu yong hong ding yi deng yu chu li zhi ling 。 zai zhe yi dian shang ,MFC de zuo fa xian ran he zhuan jia men de lun tiao bei dao er chi 。 ying dang shuo , shi Microsoft de ba qi zao jiu le MFC de ju da cheng gong ; dan cong chun cui de yu yan xue jiao du kan ,MFC zai yu yan feng ge shang de gong xian yuan bu ru ta zai chuang kou kuang jia ji shu fang mian de gong xian da 。4. mo ban —— xian dai C++ feng ge de ji chu Stroustrup yu 1988 nian shou ci gong bu le yu mo ban (template) you guan de yu fa she ji 。 hao wu yi wen , zhe shi yi xiang dui xian dai C++ de yu yan feng ge ying xiang zui da de ji shu gai jin 。 mo ban de gai nian lai zi Clu yu yan , bing zong he le Smalltalk he Ada yu yan zhong xiang guan ji shu de you dian 。1991 nian hou , bao han mo ban ji zhi de kai fa huan jing (DEC C++、IBM C++、Borland C++ deng ) lu xu wen shi 。 dan zhi dao 1995 nian STL(Standard Template Library) mo ban ku zhu jian fa zhan cheng shu yi hou , mo ban ji shu cai zai cheng xu yuan zhong xun su pu ji kai lai 。 xia mian de li zi qu zi SGI STL de shi li dai ma , ta ji ben fan yang le shi yong mo ban ji shu hou C++ dai ma de zheng ti feng ge :template <class InputIterator, class T> InputIterator find(InputIterator first, InputIterator last, const T& value) { while (first != last && *first != value) ++first; return first; } zai zhe yang de C++ dai ma zhong , chu le shao shu ji ge yao hai zi he cao zuo fu yi wai , wo men ji hu zhao bu dao duo shao C yu yan de hen ji le 。 mo ban ji shu jian gu le lei xing an quan he bian ma ling huo xing de shuang chong xu qiu , dan ta tong shi ye wei C++ yu yan yin ru le yi zhong geng jia jing miao dan ye jiao nan li jie ( xiang dui yu mei you mo ban de dai ma er yan ) de dai ma feng ge 。 xu duo chuan tong de C yu yan yong hu zhe tao yan zhe zhong feng ge de dai ma , dan geng duo de xin sheng dai cheng xu yuan dui qi zhong ai you jia 。1998 nian , zai ANSI/ISO biao zhun hua wei yuan hui de zhi chi xia ,STL bei zuo wei biao zhun C++ ku (Standard C++ Library) de yi bu fen shou ru le C++ guo ji biao zhun zhi zhong 。 jin tian , yi mo ban 、 yi chang deng xian dai C++ ji shu wei dai biao de yu yan feng ge ye yi zai shi shi shang cheng wei le C++ shi jie de “ guan fang feng ge ”。 [url=http://www.wangchao.net.cn/bbs/pydetail_1785346.html][img]http://image.wangchao.net.cn/it/1323423819812.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo 5. ATL——COM shi dai de ling lei C++ chu le STL mo ban ku zhi wai , huan you yi ge yu mo ban feng ge xiang guan de li zi 。 xia mian de dai ma pian duan qu zi Visual C++ zi dong sheng cheng de ATL kong jian gong cheng : class ATL_NO_VTABLE CMyATLObj : public IMyATLObj, public ipersistStreamInitImpl <CMyATLObj>, public IOleControlImpl<CMyATLObj>, public IOleObjectImpl<CMyATLObj>, public IoleInPlaceActiveObjectImpl <CMyATLObj>, public IViewObjectExImpl<CMyATLObj>, public IoleInPlaceObjectWindowlessImpl <CMyATLObj>, public IPersistStorageImpl<CMyATLObj>, public IspecifyPropertyPagesImpl <CMyATLObj>, public IQuickActivateImpl<CMyATLObj>, public IDataObjectImpl<CMyATLObj>, public IProvideClassInfo2Impl <&__uuidof(CMyATLObj), NULL>, public CComControl<CMyATLObj> ...... zhu chong kong jian lei CMyATLObj de dai ma ,CMyATLObj lei ju ran shi cong N ge jie kou lei he kong jian lei zhong pai sheng chu lai de , lei de sheng ming yu ju zhong sui chu ke jian mo ban de shen ying —— zhe jiu shi Microsoft wei wo men she ji de bie ju yi ge de ATL feng ge de dai ma le 。 zhi suo yi yao bu xi dai jia di da liang shi yong mo ban 、 duo chong ji xu deng yu yan te xing , zhe zhu yao wei le shi ying COM、OLE、ActiveX deng zai jia gou shang ben lai jiu xiang dui fu duo de ji shu ti xi 。 dan zhe yang yi lai , shi yong ATL de dai ma zai suo you C++ dai ma zhong , jiu yong you le yi fu yi hu ping chang de chang xiang le : dao chu dou shi jian kuo hao , dao chu dou shi yi “I” da tou de biao shi fu , shen zhi huan you duo chong jian kuo hao de qian tao …… jia ru yao qiu yi ge gang xue hui C++ yu yan de cheng xu yuan ma shang du dong yi da duan ATL dai ma , wo xiang , yong bu le ji fen zhong , ta jiu hui bei dai ma zhong na xie hui se 、 li qi de yu yan feng ge zhe mo de jing shen beng kui le 。6. biao zhun C++—— yi zhong quan xin de yu yan ? C++ yu yan de biao zhun hua jin cheng yuan yuan luo hou yu yu yan ben shen de pu ji su du 。1990 nian yi hou ,ANSI/ISO de C++ biao zhun hua wei yuan hui cai jiang bao kuo Stroustrup zai nei de da pi zhuan jia yi ji bao kuo Apple、Borland、DEC、HP、IBM、Microsoft、Sun、Unisys zai nei de zhi ming gong si zhao ji zai yi qi , xiang suo you guo jia de yi hui huo ren min dai biao da hui yi yang tong guo mei wan mei le de hui yi 、 tao lun he tou piao zhi ding C++ de guo ji biao zhun 。 biao zhun zhi dao 1998 nian 9 yue cai zheng shi fa bu 。 zai guo ji biao zhun hua zu zhi de dang an ku li ,C++ biao zhun de dai hao shi ISO/IEC 14882:1998。 Stroustrup jian yi wo men ba biao zhun C++ dang zuo yi zhong quan xin de yu yan lai xue xi [3]。 zhe yi shuo fa xian ran shi ji yu zhe yang yi ge shi shi : biao zhun C++ yu yan yi jing yong you le yi zhong wen ding de 、 ke yi tui guang de yu yan feng ge , ji , tong guo dui STL deng ji you ji shu de ken ding ,ANSI/ISO wei yuan hui zai 1998 nian de biao zhun zhong zheng shi ren ke le bao kuo mo ban 、 rong qi lei 、I/O liu ku 、 yi chang chu li deng dian xing yu yan te zheng de xian dai C++ feng ge 。 feng ge de wen ding yi wei zhe yu yan ben shen de jin bu he cheng shu , ye yi wei zhe cheng xu yuan men dui C++ de shu xi bi xu shang sheng dao yi ge xin de ceng ci —— na xie zhi jin huan zai bian xie jin you lei he C yu yan ku han shu zu cheng de C++ dai ma de cheng xu yuan , yi ding hui cheng wei Stroustrup ji qi tong ren men de qu xiao dui xiang de 。 Stroustrup de 《C++ cheng xu she ji yu yan 》 di 3 ban dui biao zhun C++ feng ge zuo le zui quan wei de chan shi 。 zai Stroustrup deng zhuan jia xue zhe de hao zhao xia , yue lai yue duo de xiang mu kai shi bian xie fu he biao zhun C++ feng ge de dai ma 。 zhe yi dian zai xu duo kai fang yuan dai ma de xiang mu zhong ti xian de fei fan ming xian 。 zhe duo ban shi you yu , shi yong C++ yu yan de kai yuan xiang mu da duo dou bu hui xiang da qi ye li de xiang mu zu na yang , zai yu yan feng ge shang hui shou dao gong si bei jing huo li shi xi guan de ji ban 。 zai ju ti de bian cheng shi jian zhong , kai yuan xiang mu de cheng xu yuan men yi fang mian ke yi guo duan di guan che biao zhun C++ de yu yan feng ge , ling yi fang mian ye ke yi gen ju zi ji de xi hao wei dai ma zeng tian yi xie gan qing se cai 。 li ru , zai OpenOffice de yuan ma zhong , biao shi fu de qian zhui gui fan jiu xiang dang you te dian , lian zhi zhen he yin yong lei xing de bian liang dou you bu tong de qian zhui zi mu qu fen ; xia mian gei chu de linux zhuo mian zhi li qi KDE 3.1.4 de yuan dai ma pian duan ze xian shi chu , kai fa KDE de cheng xu yuan zai dai ma feng ge shang huo duo huo shao shou dao le java yu yan feng ge de ying xiang :class delUser: public KDialogBase { Q_OBJECT public: delUser(KUser *AUser, QWidget *parent = 0, const char *name = 0); bool getDeleteHomeDir() { return m_deleteHomeDir->isChecked(); } bool getDeleteMailBox() { return m_deleteMailBox->isChecked(); } private: QCheckBox *m_deleteHomeDir; QCheckBox *m_deleteMailBox; }; [url=http://www.wangchao.net.cn/bbs/pydetail_1785346.html][img]http://image.wangchao.net.cn/it/1323423819852.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo 7. du bu dong de dai ma —— jian rong bing bao de yu yan feng ge shuo dao biao zhun C++ yu yan feng ge , you bi yao gei da jia kan yi duan fei chang gu guai dan ye fei chang you qu de dai ma 。 ni kan de dong xia mian zhe duan C++ dai ma ma ? ta shi zhen zheng de C++ dai ma ma ? %:include <iostream> using namespace std; %:define MAX 5 void main() <% int m<:MAX:>; int i = 1; for (i = 0; i < MAX; i++) <% m<:i:> = i; if (i not_eq 3 and i < 5) cout << i << endl; %> %> zhe shi wo zi ji bian xie de yi duan dai ma 。 ni ye xu wu fa zai Visual C++ huan jing xia yun xing ta , dan ta de yu fa de que fu he 1998 nian C++ biao zhun de gui ding 。 zai GNU C++ huan jing xia , wo zeng cheng gong di jiang qi bian yi wei ke zhi xing cheng xu 。 jian dan shuo lai , zhe duan feng ge gui yi de C++ dai ma qi shi shi gen ju C++ biao zhun zhong guan yu ke ti huan biao ji (Alternative Tokens) de gui ding er bian xie de 。 gai gui ding de she ji chu zhong shi yao shi ying ou zhou mou xie guo jia de biao zhun zi fu ji que shao “{”、“#” deng biao dian fu hao ( fei fan shi zai yi xie chuan tong de zhong duan she bei shang ) de xian zhuang 。 yan ge di jiang , zhe suan bu de yi zhong zhen zheng de yu yan feng ge , dan lei si de gui ding de que ti xian le ANSI/ISO wei yuan hui zai yu yan she ji shang jian rong bing bao de kuan guang xiong jin 。 8. C++Builder——Borland de fu xing zhi lu Borland gong si zai fa bu le Borland C++ 3.1 zhi hou , jiu yin wei bu si jin qu er jiang C++ kai fa gong ju de shi chang gong shou rang gei le Microsoft[4]。 zai jing li le Borland C++ 4.0、4.5 he 5.0 deng ban ben de shi bai hou ,1997 nian ,Borland tui chu le quan xin de C++ kai fa gong ju C++Builder。 zhe ge zai shi chang shang wei Borland wan hui le yan mian de chan pin bu dan zai jie mian feng ge shang yu Borland de zhi zhu chan pin Delphi bie wu er zhi , shen zhi huan zai chan pin nei bu zhi jie zhao ban le Delphi de VCL(Visual Component Library) ku 。 jie guo , shi yong C++Builder kai fa de dai ma tian sheng jiu shou dao le Delphi feng ge de chuan ran , chang xiang ku si Pascal yu yan le ( yi xia dai ma qu zi C++Builder 6.0 de shi li dai ma ):class TFormClrDlg : public TForm { published: // IDE-managed Components TColorDialog *ColorDialog; TButton *Button; TPanel *Panel1; void fastcall ButtonClick(TObject *Sender); private: // User declarations public: // User declarations virtual fastcall TFormClrDlg(TComponent* Owner); }; shuo shi hua , jin guan C++Builder zai shi chang shang de biao xian bu cuo , dan wo huan shi bu xi huan Borland jiang C++ yu yan yu Delphi zhong de Object Pascal yu yan ke yi hun xiao de zuo fa 。 ye xu zai Borland zhe zhong zuo fa de bei hou you ti gao chan pin tong yong xing 、 suo duan chan pin kai fa zhou qi deng ti mian de li you , dan shi yong C++Builder kai fa chu de dai ma zai wai biao shang yi jing li biao zhun C++ feng ge yue lai yue yuan le 。 zhi de zhu chong de shi ,Borland yu 2003 nian tui chu le qi xia yi dai C++ kai fa gong ju ——C++BuilderX。 rang ren ku xiao bu de de shi , zhe yi ci Borland ju ran jiang C++ kai fa huan jing gou zhu zai le yong Java yu yan shi xian de PrimeTime ping tai shang , zhe duo shao jiang C++ yu yan tui xiang le yi zhong ji wei gan ga de chu jing 。 bu guo ,C++BuilderX ye wei wo men dai lai le yi xie hao xiao xi : zai hou xu de ban ben zhong ,C++BuilderX jiang ji cheng vxWindows kuang jia ku [5], zai zhe zhong kuang jia xia kai fa de C++ dai ma xian ran yao bi shi yong VCL de dai ma ju bei geng duo de biao zhun C++ feng ge 。9. Visual C++ .NET—— ge ming huan shi pan ni ? Microsoft jiang C++ yin ru .NET huan jing de ju dong qi shi bi Borland huan yao ji jin 。 dan cong feng ge shang shuo , shi yong Visual C++ .NET kai fa de dai ma ke neng jian ju MFC、ATL、 biao zhun C++、.NET tuo guan dai ma deng duo zhong bu tong de feng ge 。 qi zhong , dui C++ yu yan ben shen ying xiang zui da de , dang ran yao shu .NET tuo guan dai ma wei C++ zhu ru de ruo gan xin xian xue ye le :#using <mscorlib.dll> using namespace System; using namespace System::Reflection; using namespace System::Security::Permissions; public __value enum SomeStuff { e1 = 1, e17 = 17 }; [attribute(AttributeTargets::Class, AllowMultiple=true)] public __gc class ABC { public: ABC(int __gc[]) {} ABC() {} ABC(int) {} ABC(int, float) {} ABC(SomeStuff) {} ABC(String*) {} int rgnField __gc []; double rgdField __gc []; double dField; }; shang shu dai ma lai zi MSDN zhong de shi li cheng xu 。 kan dao Microsoft da dao kuo fu di wei C++ yu yan yin ru de la ji shou ji 、Attribute shu xing deng xin te xing he xin ji shu , kan dao .NET tuo guan dai ma xin qi de jin hu li jing pan dao de yu yan feng ge , wo bu zhi dao shi ying gai wei Microsoft zai fa zhan tong yong yu yan ping tai shang de nu li er huan hu que yue , huan shi ying gai wei C++ zai C# yu yan yin ying xia ri jian qu ju .NET da xi zhong de pei jiao er hui xin sang qi 。 ye xu , yu yan feng ge he cheng xu yuan de gan shou zai Microsoft yan zhong , dou shi xie bu zhi yi ti de xiao shi , ta men na neng he .NET de hong wei zhan lue ji Microsoft de qiang da di guo xiang ti bing lun ne ?10. hui gu he zhan wang yu yan feng ge de bian qian cong yi ge ce mian fan yang le ji shu si xiang he chan ye xu qiu de chan bian gui lv 。 cong 1979 nian Stroustrup wan cheng di yi ge Cpre yu chu li cheng xu suan qi ,C++ yu yan lai dao zhe ge shi jie shang yi jing kuai man 25 ge nian tou le 。 zhe shi yi zhong zai shi jian zhong dan sheng 、 cheng chang he fa zhan qi lai de yu yan 。 ye xu ,Stroustrup cong yi kai shi jiu ya gen er ye mei xiang ba ta she ji cheng xiang Smalltalk na yang chun cui de mian xiang dui xiang yu yan 。 kai fang xing 、 gao xiao lv 、 jian rong xing he kuo zhan xing de xu qiu jiang C++ yu yan su zao cheng le yi zhong dian xing de duo mo shi (Multiparadigm) yu yan 。 wu lun shi C++ zao qi dui Simula yu yan de ji xu , huan shi hou lai dui Smalltalk、Ada、Clu deng yu yan de jie jian , wu lun shi ANSI/ISO biao zhun feng ge de xun su pu ji , huan shi Visual C++ .NET zai ji shu chuang xin shang de bu xie nu li , suo you zhe xie li shi bian qian dou shuo ming ,C++ zai feng ge shang de duo yang xing zhu yao yuan zi C++ yu yan ben shen “ hai na bai chuan ” de xiong jin he qi gai 。 5 nian yi hou , dang C++ bu ru er li zhi nian de shi hou , ta hui gei wo men dai lai xin de jing xi ma ? wo men huan hui kan dao geng jia xin qi de C++ yu yan feng ge ma ? ye xu , mei you shui neng gei chu zhun que de da an 。 dan zuo wei cheng xu yuan , wo men zhi shao ying gai zhi dao : wu lun mian dui shen me yang de ruan jian xu qiu , wu lun shi yong shen me yang de si wei fang shi ,C++ yu yan dou fu yu le wo men xuan ze yu yan feng ge de zui da zi you ; dang wo men zhen zheng li jie le C++ yu yan de jing shen shi zhi zhi hou , zhe zhong zi you ye bi jiang cheng wei suo you you xiu ruan jian he you ya dai ma de jian shi ji chu 。 shen kao wen xian [1] liu xie . wen xin diao long · xu zhi . [2] Stroustrup B. C++ yu yan de she ji he yan hua . bei jing : ji xie gong ye chu ban she , 2002 [3] Stroustrup B. Learning Standard C++ as a New Language. C/C++ Users Journal. pp 43-54. May 1999. [4] li wei . Borland chuan qi . bei jing : dian zi gong ye chu ban she , 2003 [5] li wei . xi shuo Borland C++BuilderX. cheng xu yuan . 2003.11 [url=http://www.wangchao.net.cn/bbs/pydetail_1785346.html][img]http://image.wangchao.net.cn/it/1323423819885.gif[/img][/url] geng duo nei rong qing kan C/C++ ji shu zhuan ti zhuan ti , huo
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
清凉一夏_清纯美丽
纯白色小礼服
靓丽可人儿_嘉嘉
我的女神_靓丽女生
主题摄影
贵州,让我欢喜,让我神伤。
莫干山
天平秋色
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有