Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C#ÖÐC/C++³ÌÐòÔ±×¢ÒâÎÊÌâ

1¡¢C/C++³ÌÐòÔ±Çë×¢Ò⣬²»ÄÜÔÚcaseÓï¾ä²»Îª¿Õʱ“ÏòÏÂÖ´ÐД¡£
2¡¢ÖµÀàÐͺÍÒýÓÃÀàÐÍÖ®¼äµÄÇø±ð£ºC#µÄ»ù±¾ÀàÐÍ£¨int£¬charµÈ£©¶¼ÊÇÖµÀàÐÍ£¬ÊÇÔÚÕ»Öд´½¨µÄ¡£¶ø¶ÔÏóÊÇÒýÓÃÀàÐÍ£¬´´½¨ÓÚ¶ÑÖУ¬ÐèҪʹÓùؼü×Önew¡£
3¡¢ÔÚC#ÖÐͨ¹ýʵÀý·ÃÎʾ²Ì¬·½·¨»ò³ÉÔ±±äÁ¿ÊDz»ºÏ·¨µÄ£¬»áÉú³É±àÒëÆ÷´íÎó¡£µ«ÊÇÎÒÃÇ¿ÉÒÔͨ¹ýÉùÃ÷ËûÃǵÄÀàµÄÃû×ÖÀ´·¢·ÃÎʾ²Ì¬³ÉÔ±¡£
4¡¢C#ÅÉÉúÀàÖУ¬Ã»ÓÐ˽ÓлòÕß±£»¤¼Ì³Ð¡£¹ØÓÚÕâÒ»µãC++³ÌÐòÔ±×¢ÒâÁË¡£
5¡¢C#¶à̬ÐÔ,C++³ÌÐòÔ±×¢Òâ,±ØÐëÏÔʽÓùؼü×Ôoverride±ê¼ÇÖØж¨ÒåÁËÐé·½·¨µÄ·½·¨ÉùÃ÷¡£
6¡¢³éÏóÀàÓëÃÜ·âÀ࣬³éÏóÀàÓÃÀ´±»ÅÉÉú£¬²¢ÎªÆä×ÓÀàÌṩ×ñÑ­Ä£°æ£»¶øÃÜ·âÀàÔòÍêÈ«²»ÔÊÐí±»ÅÉÉú¡£³éÏóÀà¹Ø¼ü×ÖÊÇabstract£»ÃÜ·âÀà¹Ø¼ü×ÖΪsealed
7¡¢C#ÖнṹÌåµÄ¶¨ÒåÓëC++µÄ·Ç³£²»Í¬¡£ÔÚC++ÖУ¬½á¹¹ÌåÓëÀà³ýÁËĬÈϵĿɼûÐÔ£¨Ò»¸öÊÇpublic£¬Ò»¸öÊÇprivae£©Ö®ÍâÍêÈ«Ò»Ñù¡£¶øÔÚC#ÖУ¬½á¹¹ÌåÊÇÖµÀàÐÍ£¬¶øÀàÊÇÒýÓÃÀàÐÍ¡£
8¡¢C#ÖÐίÍÐÏ൱ÓÚC++Öеķ½·¨Ö¸Õ룬¹Ø¼ü×ÖΪdelegate¡£
9¡¢.NETÓÃÀ´´´½¨ÍøÒ³³ÌÐòµÄ¼¼ÊõÊÇASP.NET2.0£¬ËüÔÚÃüÃû¿Õ¼äSystem.WebºÍSystem.Web.UIÖÐΪ´´½¨ÍøÒ³³ÌÐòÌṩÁËÒ»Ì׷ḻµÄÀàÐÍ¡£
10¡¢C#Ïß³ÌÈýÖÖͬ²½»úÖÆ£º»¥ËøÀࣨInterlocked£©£¬C# lockÓï¾ä£¬ÒÔ¼°¼à¿ØÆ÷¶ÔÏó£¨Monitor class£©
11¡¢C#ÖÐҪʹÓÃÖµ±äÁ¿Ö®Ç°£¬ÐèÒªÊÂÏÈÉùÃ÷£¬²¢ÇÒÒªÔÚʹÓÃ֮ǰÏÈÉèÖóõʼֵ£¬ÓÀÔ¶²»¿ÉΪnull£»ÒýÓÃÀàÐͱäÁ¿£¬´æ´¢ÔÚheapÖУ¬²»ÔÊÐíÔÚ³õʼ»¯Ö®Ç°Ê¹ÓÃÕâ¸ö±äÁ¿¡£
12¡¢C#ÖÐswitch-caseÓï¾äÓëC/C++²»Í¬µØ·½ÔÚÓÚC#Öв»ÔÊÐícaseÅжÏʽ“silent fall through”¡£Ò²¾ÍÊÇ˵£¬µ±ÕÒµ½·ûºÏcase±ê¼ÇºóµÄ³£Êýºó£¬Ö»»áÖ´ÐдËcaseÇø¿éÖеijÌÐò´úÂ룬²»»áÔÙÖ´ÐÐÆäËûµÄcaseÅжÏʽ½øÐÐÅжϵĶ¯×÷¡£
13¡¢²ÎÊý´«Èë»úÖÆ
14¡¢C#ÖÐʹÓÃÊý×éҪעÒâÁ½¼þÊÂÇ飺Êý×éÃû³Æ²»¿ÉÖÃÓÚÖÐÀ¨ºÅÇ°·½£»ÉùÃ÷Êý×é±äÁ¿Ê±£¬²»Äܹ»Ö¸¶¨Êý×éµÄ´óС¡£
15¡¢Àà
C#µÄ³ÉÔ±·ÃÎÊÐÞÊηû°üº¬ÒÔϼ¸ÖÖ£º
Public
ÈκÎÍⲿµÄÀ඼¿ÉÒÔ²»ÊÜÏÞÖƵĴæÈ¡Õâ¸öÀàµÄ·½·¨ºÍÊý¾Ý³ÉÔ±¡£
Private
ÀàÖеÄËùÓз½·¨ÓëÊý¾Ý³ÉÔ±Ö»ÄÜÔÚ´ËÀàÖÐʹÓã¬ÍⲿÎÞ·¨´æÈ¡¡£
Protected
³ýÁËÈñ¾ÉíµÄÀà¿ÉÒÔʹÓÃÖ®Í⣬Èκμ̳Ð×Ô´ËÀàµÄ×ÓÀ඼¿ÉÒÔ´æÈ¡¡£
Internal
ÔÚͬһ¸ö.NET Assembly£¨Application»òLibrary£¬Ò²¾ÍÊÇ˵£¬Í¬Ò»¸öEXE»òͬһ¸öDLLÖеijÉÔ±£©Öж¼¿ÉÒÔ´æÈ¡¡£
Protected internal
Ö»ÏÞ¶¨Ä¿Ç°µÄÏîÄ¿£¬»òÊǼ̳Ð×Ô´ËÀàµÄ³ÉÔ±²Å¿ÉÒÔ´æÈ¡¡£
½á¹¹ÓëÀàµÄ²îÒ죺
16¡¢ÖµÀàÐÍÓëÒýÓÃÀàÐÍÖ®¼äµÄ»¥»»³


Ïà¹ØÎĵµ£º

GNU C __attribute__ »úÖƼò½é

GNU C __attribute__ »úÖƼò½é
2006-06-17 13:54:00
¡¡±êÇ©£º¡¡¡¡¡¡[ÍÆË͵½¼¼ÊõȦ]
ͻ񻣼
ÔÚѧϰlinuxÄں˴úÂ뼰һЩ¿ªÔ´Èí¼þµÄÔ´Â루È磺DirectFB£©£¬¾­³£¿ÉÒÔ¿´µ½ÓйØ__attribute__µÄÏà¹ØʹÓᣱ¾ÎĽáºÏ×Ô¼ºµÄѧϰ¾­Àú£¬½ÏΪÏêϸµÄ½éÉÜÁË__attribute__Ïà¹ØÓï·¨¼°ÆäʹÓá£
-------------------------------------- ......

Comparing C++ and Java

Many developers already have experience with an object-oriented programming language like C++. As you make the transition to Java, you will encounter many differences, despite some strong similarities. In this excerpt from "Thinking in Java", Bruce Eckel highlights the important differences that C++ ......

C#ʹÓÃSQLDMOʵÏÖ¶ÔMSSQLÊý¾Ý¿â½øÐб¸·ÝºÍ»Ö¸´

public sealed class DbOper
{
     ///<summary>
     /// DbOperÀàµÄ¹¹Ô캯Êý
     ///</summary>
     private DbOper()
     {
     }
     ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ