資源描述:
《delphi及c#語法比較》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在學(xué)術(shù)論文-天天文庫。
1、窗體頂端窗體底端您查詢的關(guān)鍵詞是:delphi?c#?。如果打開速度慢,可以嘗試快速版;如果想保存快照,可以添加到搜藏。(百度和網(wǎng)頁http://www.360doc.com/content/070405/11/2908_431505.html的作者無關(guān),不對其內(nèi)容負(fù)責(zé)。百度快照謹(jǐn)為網(wǎng)絡(luò)故障時(shí)之索引,不代表被搜索網(wǎng)站的即時(shí)頁面。)幫助?
2、?留言交流?
3、?首頁我的圖書館主題閱讀精彩目錄精品文苑Tags會(huì)員瀏覽好書推薦DELPHI與C#語法比較(轉(zhuǎn)載)kenwang收錄于2007-04-05閱讀數(shù):公眾公開?原文來源 DELPHIandC#ComparisonDELPHI7與C#語法比較編制
4、:黃煥堯參考:VB.netandC#Comparison日期:2005-5-30.Comments注釋DataTypes數(shù)據(jù)類Constants常量Enumerations枚舉Operators運(yùn)算Choices選擇語句Loops循環(huán)語句Arrays數(shù)組Functions函數(shù)ExceptionHandling異常處理Namespaces命名空間Classes/InterfacesConstructors/Destructors構(gòu)造/釋構(gòu)Objects對象Structs結(jié)構(gòu)Properties屬性Delegates/EventsConsoleI/OFileI/ODELPHIC#Commen
5、ts注釋//Singlelineonly{?Multipleline}(*?Multipleline*)//Singleline/*Multiple???line?*////XMLcommentsonsingleline/**XMLcommentsonmultiplelines*/DataTypes數(shù)據(jù)類型ValueTypes簡單類型BooleanByteChar??(example:"A"c)Word,Integer,Int64Real,Single,Double,Real48,Extended,Comp,CurrencyDecimalTdate,TDateTimeReferenceT
6、ypesObjectString(ShortString,AnsiString,WideString)Set,array,record,file,class,classreference,interfacepointer,procedural,variantvarx:Integer;WriteLine(x);????//?PrintsSystem.Int32WriteLine('Ingeger’);?//PrintsInteger//?TypeconversionvarnumDecimal:Single=3.5;varnumInt:Integer;numInt:=Integer(numD
7、ecimal)??//setto4(Banker'srounding)thedecimal)ValueTypesboolbyte,sbytechar??(example:'A')short,ushort,int,uint,long,ulongfloat,?doubledecimalDateTime??(notabuilt-inC#?type)ReferenceTypesobjectstringintx;Console.WriteLine(x.GetType());????//PrintsSystem.Int32Console.WriteLine(typeof(int));?????//P
8、rintsSystem.Int32//TypeconversiondoublenumDecimal=3.5;intnumInt=(int)numDecimal;??//setto?3?(truncatesdecimal)Constants常量Const?MAX_STUDENTS:Integer=25;constintMAX_STUDENTS=25;Enumerations枚舉TypeTaction1=(Start,Stop,Rewind,Forward);{$M+}TypeStatus=(Flunk=50,Pass=70,Excel=90);enumAction{Start,Stop,R
9、ewind,Forward};enumStatus{Flunk=50,Pass=70,Excel=90};Actiona={$M-}vara:Taction1=Stop;Ifa<>StartThenWriteLn(ord(a));???//Prints?1WriteLine(Ord(Pass));????//Prints70WriteLine(GetEnumName(TypeInfo(Status),Ord(Pass)));???/