20100601 cÏÝÚåÓëÖ¸Õë¶ÁÊé±Ê¼Ç£¨µÚËÄÎåÁùÕ£©
ÕâÈýÕÂÖ÷Òª½²ÁËCÓïÑÔµÄÁ´½Ó¡¢¿âº¯Êý¡¢Ô¤´¦Àí¡£»¹ÊÇÓеã»ÞɬÄѶ®°¡¡£
Ò»¸öC³ÌÐòÊÇ¿ÉÒÔÓжà¸ö²¿·Ö×é³ÉµÄ£¬µ«ÊDZàÒëÆ÷ÿ´ÎÖ»ÄܱàÒëÒ»¸öÎļþ£¬ÕÒ³öÆäÖеĴíÎó¡£Ä³Ð©CÓïÑÔʵÏÖÌṩÁËÒ»¸ö³ÆΪlintµÄ³ÌÐò£¬¿ÉÒÔ²¶»ñ´óÁ¿µÄ´ËÀà´íÎó¡£Á¬½ÓÆ÷Ò»°ãÊÇÓë±àÒëÆ÷·ÖÀëµÄ£¬±àÒëÆ÷ÊÇ°ÑC³ÌÐò“·Ò딳ɶÔÁ¬½ÓÆ÷ÓÐÒâ˼µÄÐÎʽ£¬ÕâÑùÁ¬½ÓÆ÷¾ÍÄÜ“¶Á¶®”C³ÌÐòÁË¡£
¶ÔÓÚͬÃûÒýÆðµÄ³åÍ»£¬ÎÒÃÇ¿ÉÒÔ½«ÕâЩ·Åµ½Ò»¸öÔ´ÎļþÖУ¬²¢ÓÃstaticÐÞÊΣ¬ÓÃÓÚÈô¸Éº¯Êý¹²ÏíÕâЩÊý¾Ý¡£»¹ÓÐÒ»¸öºÃ·½·¨¾ÍÊÇÿ¸öÍⲿ¶ÔÏóÖ»ÔÚÒ»¸öµØ·½ÉùÃ÷£¬Õâ¸öÉùÃ÷µÄµØ·½Ò»°ã¾ÍÔÚÒ»¸öÍ·ÎļþÖУ¬ÐèÒªÓõ½¸ÃÍⲿ¶ÔÏóµÄËùÓÐÄ£¿é¶¼Ó¦¸Ã°üÀ¨Õâ¸öÍ·Îļþ¡£
CÓïÑÔÖÐĬÈϵĺ¯ÊýÀàÐÍΪint¡£Èκκ¯Êý¶¼Ó¦¸ÃÔÚµÚÒ»´Î±»µ÷ÓÃ֮ǰ½øÐÐÉùÃ÷»òÕ߶¨Ò壬Èô²»ÕâÑù£¬º¯ÊýµÄĬÈÏÀàÐ;ÍΪintÁË¡£º¯ÊýÉùÃ÷ʱ£¬ÐβγýÁËfloat,short,charÀàÐ͵IJÎÊý£¬ÔÚº¯ÊýÉùÃ÷ÖÐÍêÈ«¿ÉÒÔÊ¡ÂÔ²ÎÊýµÄÀàÐÍ˵Ãû¡£
ºê¶¨Òå#define£¬Ô¤´¦ÀíÃüÁÔÚ±àÒë֮ǰÍê³É£¬¿ÉÒÔ¼ò»¯ÎÒÃǵĴúÂë¡£ÓÐʱºò¿´ÉÏÈ¥Ïñ¸öº¯Êý£¬È´Ã»Óк¯ÊýµÄ¿ªÏú¡£ºêÌṩÁ˶Ô×Ö·ûµÄÌæ»»¹¦ÄÜ£¬È´²»Ê¹ÓöÔÏó¡£
ºêµÄʹÓÃÊÇ£º#define ºêÃû Ìæ»»ÄÚÈÝ ÆäÖеĿոñÐèҪעÒâ¡£²»È»»áÒýÆð´íÎó¡£ÔÚʹÓúêµÄʱºò£¬Èç¹ûÓжԲÎÊýµÄ²Ù×÷£¬²»ÄÜÖظ´¶à´Î£¨ÀýÈç++£¬——£©£¬Ã¿Ò»´ÎÌæ»»¶¼»áʹ²Ù×÷Öظ´Ò»´Î£¬´Ó¶ø´øÀ´´íÎó¡£È·±£ºêûÓдíÎó£¬Ó¦¸Ã×¢ÒâʹÓÃÀ¨ºÅ¡£
Ò»¶¨Òª×¢ÒâµÄÊÇ£¬ºêÖ»ÊÇÌæ»»£¡£¡
Ïà¹ØÎĵµ£º
C/C++ Reference
http://www.cppreference.com/
C++ Library Reference
http://www.cplusplus.com/ref/
Standard C++ Library Class Reference at Rogue Wave
http://www.roguewave.com/support/docs/hppdocs/stdref/
Dink ......
1. ÔõÑù½¨Á¢ºÍÀí½â·Ç³£¸´ÔÓµÄÉùÃ÷£¿ÀýÈ綨ÒåÒ»¸ö°üº¬N ¸öÖ¸Ïò·µ»ØÖ¸Ïò×Ö·ûµÄÖ¸ÕëµÄº¯ÊýµÄÖ¸ÕëµÄÊý×飿
Õâ¸öÎÊÌâÖÁÉÙÓÐÒÔÏÂ3 ÖÖ´ð°¸:
1. char *(*(*a[N])())();
2. ÓÃtypedef Öð²½Íê³ÉÉùÃ÷:
typedef char *pc; /* ×Ö·ûÖ¸Õë*/
typedef pc fpc(); /* ·µ»Ø×Ö·ûÖ¸ÕëµÄº¯Êý*/
typedef fpc *pfpc; /* ÉÏÃ溯ÊýµÄÖ¸Õë*/ ......
linux³£ÓÃÍ·ÎļþÈçÏ£º
POSIX±ê×¼¶¨ÒåµÄÍ·Îļþ
<dirent.h>
Ŀ¼Ïî
<fcntl.h> Îļþ¿ØÖÆ
<fnmatch.h> ÎļþÃûÆ¥ÅäÀàÐÍ
<glob.h>
·¾¶ÃûģʽƥÅäÀàÐÍ
< ......
´ÓijλÍøÓѵIJ©¿Í¿´µ½¹ØÓÚextern "C"Ó÷¨µÄÎÄÕ£¬½²µÃ·Ç³£Í¸³¹£¬ÓÚÊǾÍÕª³ÁËÎÒ֮ǰ²»ÉõÁ˽âµÄ²¿·Ö×ö¸öbackup¡£
Ò»¡¢´ÓCÓëC++±àÒëÁ¬½Ó·½Ê½ÉîÈëÀí½âextern "C"
<1>.CºÍC++¶Ôº¯ÊýµÄ´¦Àí·½Ê½ÊDz»Í¬µÄ.±»extern "C"ÐÞÊεıäÁ¿ºÍº¯ÊýÊÇ°´ÕÕCÓïÑÔ·½Ê½±àÒëºÍÁ¬½ÓµÄ.extern "C"ÓÃÓÚʵÏÖC++ÓëC¼°ÆäËüÓïÑԵĻìºÏ±à³Ì¡ ......