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

C#——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¡¢ÖµÀàÐÍÓëÒýÓÃÀàÐÍÖ®¼äµÄ»¥»


Ïà¹ØÎĵµ£º

C/C++ÓÚJavaÖ®¼äµÄ»¥Ïàµ÷ÓÃ

ÀûÓÃJNI¼¼Êõ£¬¿ÉÒÔ×öµ½C/C++ÓëJavaÖ®¼äµÄÏ໥µ÷Óá£
1¡¢Javaµ÷ÓÃC/C++½Ó¿Ú
Õâ¸öÊÇJNI×î»ù±¾µÄÓ¦Óã¬JNIÓкܶàÕâ·½ÃæµÄÀý×Ó´úÂë¡£Ò»°ã°ÑC/C++д³É¶¯Ì¬Á´½Ó¿â£»ÔÚJava³ÌÐòÔÚLoadLibrary£¬ÀûÓÃnative½Ó¿Ú£¬¼´¿ÉÍê³Éµ÷Óá£
2¡¢C/C++»Øµ÷Java½Ó¿Ú
ÕâÖÖÓ÷¨£¬JNIµÄÀý×ӱȽÏÉÙ¡£Æäʵ£¬Ò²±È½Ï¼òµ¥£¬JNIÒ²ÌṩÁËÕâÑùµÄ½Ó¿Ú¡ ......

C/C++ÖÐÔ¤±àÒë#,##,#error£¬#pragma×÷ÓÃ


#
ÊÇÉú³É×Ö·û´®£º
          #define a(x) #x
          a(bc
) => "bc"
##
ÊÇÁ¬½Ó£º
          #define a(x) abc##x
     &n ......

C#ÏÔʾXMLÔªËØÄÚÈݵļòµ¥Àý×Ó

½ÓÉÏһƪ
ÏÔʾËùÓнáµãµÄÄÚÈÝ
1 Ô­xmlÎļþ bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book ISBN="1234123">
    <title>who am i </title>
    <author>who</author>
    <price> ......

jni £¯ C for android ¼¼Êõ×ÜÀ¿

Android±àÒë»·¾³(1) - ±àÒëNative CµÄhelloworldÄ£¿é
Android±àÒë»·¾³±¾Éí±È½Ï¸´ÔÓ£¬ÇÒ²»ÏñÆÕͨµÄ±àÒë»·¾³£ºÖ»Óж¥²ãĿ¼Ï²ÅÓÐMakefileÎļþ£¬¶øÆäËûµÄÿ¸öcomponent¶¼Ê¹ÓÃͳһ±ê×¼µÄAndroid.mk. Android.mkÎļþ±¾ÉíÊDZȽϼòµ¥µÄ£¬²»¹ýËü²¢²»ÊÇÎÒÃÇÊìϤµÄMakefile£¬¶øÊǾ­¹ýÁËAndroid×ÔÉí±àÒëϵͳµÄºÜ¶à´¦Àí£¬Òò´ËÒªÕ ......

¡¾C\C++ÓïÑÔÈëÃÅƪ¡¿ ½á¹¹Ìå

Ç°ÃæÁ½Æª»ù±¾°ÑÖ¸Õë¸ø½éÉÜÍêÁË£¬ÏàÐÅ´ó¼Ò¶ÔÖ¸ÕëÒѾ­²»ÊÇÄÇôİÉúÁË¡£Ò²²»»áÒòΪָÕëºÍÊý×éÖ®¼äµÄ¹Øϵ¶øµ¼Ö»ìÏýÁË¡£´ó¼Ò¿ÉÄÜÒ²ÆȲ»¼°´ýÏëÁ˽âϺóÀ´µÄ֪ʶ¡£½ñÌìÎÒÃǾͽéÉÜϽṹÌå¡£
¶ÔÓڽṹÌ壬¼ÈÈ»½Ð½á¹¹Ì壬ÐÎÏóÉÏÎÒÃÇ¿ÉÒÔÀí½âÆä¾ÍÊÇÒ»¶ÑÊý¾Ý¼¯ºÏÔÚÒ»ÆðÐγÉÒ»¸ö½á¹¹¡£¾Í±ÈÈçÒ»¸öѧÉúµÄÐÅÏ¢°üÀ¨£ºÑ§ºÅ¡¢ÐÕÃû¡¢°à¼¶¡¢Äê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ