¸ßÖÊÁ¿ C/C++±à³Ì±Ê¼Ç
¸ßÖÊÁ¿C++±à³Ì Note
¶¨Òå1£ºÄܳ¤ÆÚÎȶ¨µØ±àд³ö¸ßÖÊÁ¿³ÌÐòµÄ³ÌÐòÔ±³ÆΪ±à³ÌÀÏÊÖ¡£
¶¨Òå2£ºÄܳ¤ÆÚÎȶ¨µØ±àд³ö¸ßÄѶȡ¢¸ßÖÊÁ¿³ÌÐòµÄ³ÌÐòÔ±³ÆΪ±à³Ì¸ßÊÖ¡£
°æȨºÍ°æ±¾µÄÉùÃ÷λÓÚÍ·ÎļþºÍ¶¨ÒåÎļþµÄ¿ªÍ· £¬Ö÷ÒªÄÚÈÝÓУº
£¨1£©°æȨÐÅÏ¢¡£
£¨2£©ÎļþÃû³Æ£¬±êʶ·û£¬ÕªÒª¡£
£¨3£©µ±Ç°°æ±¾ºÅ£¬×÷Õß/ÐÞ¸ÄÕߣ¬Íê³ÉÈÕÆÚ¡£
£¨4£©°æ±¾ÀúÊ·ÐÅÏ¢¡£
Í·ÎļþÓÉÈý²¿·ÖÄÚÈÝ×é³É£º
£¨1£©Í·Îļþ¿ªÍ·´¦µÄ°æȨºÍ°æ±¾ÉùÃ÷¡£
£¨2£©Ô¤´¦Àí¿é¡£
£¨3£©º¯ÊýºÍÀà½á¹¹ÉùÃ÷µÈ¡£
¶¨ÒåÎļþÓÐÈý²¿·ÖÄÚÈÝ£º £¨1£© ¶¨ÒåÎļþ¿ªÍ·´¦µÄ°æȨºÍ°æ±¾ÉùÃ÷¡£
£¨2£© ¶ÔһЩͷÎļþµÄÒýÓá£
£¨3£© ³ÌÐòµÄʵÏÖÌ壨°üÀ¨Êý¾ÝºÍ´úÂ룩 ¡£
Èç¹ûÒ»¸öÈí¼þµÄÍ·ÎļþÊýÄ¿±È½Ï¶à£¨È糬¹ýÊ®¸ö£© £¬Í¨³£Ó¦½«Í·ÎļþºÍ¶¨ÒåÎļþ·Ö±ð±£´æÓÚ²»Í¬µÄĿ¼£¬ÒÔ±ãÓÚά»¤¡£
ÔÚÿ¸öÀàÉùÃ÷Ö®ºó¡¢Ã¿¸öº¯Êý¶¨Òå½áÊøÖ®ºó¶¼Òª¼Ó¿ÕÐС£
ÔÚÒ»¸öº¯ÊýÌåÄÚ£¬ÂßÒ¾ÉÏÃÜÇÐÏà¹ØµÄÓï¾äÖ®¼ä²»¼Ó¿ÕÐУ¬ÆäËüµØ·½Ó¦¼Ó¿ÕÐзָô¡£
Ò»ÐдúÂëÖ»×öÒ»¼þÊÂÇ飬ÈçÖ»¶¨ÒåÒ»¸ö±äÁ¿£¬»òֻдһÌõÓï¾ä¡£ÕâÑùµÄ´úÂëÈÝÒ×ÔĶÁ£¬²¢ÇÒ·½±ãÓÚдעÊÍ¡£
if¡¢for¡¢while¡¢do µÈÓï¾ä×ÔÕ¼Ò»ÐУ¬Ö´ÐÐÓï¾ä²»µÃ½ô¸úÆäºó¡£²»ÂÛÖ´ÐÐÓï¾äÓжàÉÙ¶¼Òª¼Ó{}¡£ÕâÑù¿ÉÒÔ·ÀÖ¹ÊéдʧÎó¡£
¹Ø¼ü×ÖÖ®ºóÒªÁô¿Õ¸ñ¡£Ïó const¡¢virtual¡¢inline¡¢case µÈ¹Ø¼ü×ÖÖ®ºóÖÁÉÙÒªÁôÒ»¸ö¿Õ¸ñ£¬·ñÔòÎÞ·¨±æÎö¹Ø¼ü×Ö¡£Ïó if¡¢for¡¢while µÈ¹Ø¼ü×ÖÖ®ºóÓ¦ÁôÒ»¸ö¿Õ¸ñÔÙ¸ú×óÀ¨ºÅ‘ £¨’ £¬ÒÔÍ»³ö¹Ø¼ü×Ö¡£
º¯ÊýÃûÖ®ºó²»ÒªÁô¿Õ¸ñ£¬½ô¸ú×óÀ¨ºÅ‘ £¨’ £¬ÒÔÓë¹Ø¼ü×ÖÇø±ð¡£
‘ £¨’Ïòºó½ô¸ú£¬ ‘£© ’ ¡¢ ‘£¬ ’ ¡¢ ‘;’ÏòÇ°½ô¸ú£¬½ô¸ú´¦²»Áô¿Õ¸ñ¡£
‘£¬ ’Ö®ºóÒªÁô¿Õ¸ñ£¬Èç Function(x, y, z)¡£Èç¹û‘;’²»ÊÇÒ»ÐеĽáÊø
·ûºÅ£¬ÆäºóÒªÁô¿Õ¸ñ£¬Èç for (initialization; condition; update)¡£
¸³Öµ²Ù×÷·û¡¢±È½Ï²Ù×÷·û¡¢ËãÊõ²Ù×÷·û¡¢Âß¼²Ù×÷·û¡¢Î»Óò²Ù×÷·û£¬Èç“=” ¡¢ “+=” “>=” ¡¢ “<=” ¡¢ “+” ¡¢ “*” ¡¢ “%” ¡¢ “&&” ¡¢ “||” ¡¢ “<<”,“^”µÈ¶þÔª²Ù×÷·ûµÄÇ°ºóÓ¦µ±¼Ó¿Õ¸ñ¡£
Ò»Ôª²Ù×÷·ûÈç“!” ¡¢ “~” ¡¢ “++” ¡¢ “--” ¡¢
Ïà¹ØÎĵµ£º
[This was posted to comp.lang.c by its author, David Anderson, on 1994-05-06.]
The ``Clockwise/Spiral Rule''
By David Anderson
There is a technique known as the ``Clockwise/Spiral Rule'' which enables any C programmer to parse in their head any C declaration!
There are three simple steps to fo ......
»Ø¹Ë֮ǰµÄƪ·ù£¬CÓïÑÔµÄÖ÷Ì岿·Ö»ù±¾ÒѾ½éÉÜÍêÁË¡£Ö®ËùÒÔûÓнéÉÜC++µÄÏà¹ØÌØÐÔÊÇÒòΪÔÚ֮ǰµÄÎÄÕÂÖÐCºÍC++ÔÚÕâЩ·½Ã涼Óй²ÐÔ£¬ËùÒÔÔÚÃæÏò¶ÔÏó֮ǰ¡£ÎÒÃÇÏÈ°ÑÕâЩ¹²ÐÔ¸ø½éÉÜÍê¡£Ò²¾ÍÊÇ˵ÔÚ½éÉÜÃæÏò¶ÔÏó֮ǰ£¬ËùÓеÄÎÄÕ¶¼ÊÇCC++Öж¼ÄÜʹÓõġ£´ÓÕâµãÉÏÀ´¿´£¬ÏÖÔÚÕý¼«Á¦·Ü¶·ÓÚC++Õ½ÏßÉϵijõѧÕß»¹ÊǺÜÓÐÓô¦µÄ¡£
±¾Æª¼ÌÐ ......
C/C++ÓïÑÔvoid¼°voidÖ¸ÕëÉî²ã̽Ë÷
1.¸ÅÊö
Ðí¶à³õѧÕ߶ÔC/C++ÓïÑÔÖеÄvoid¼°voidÖ¸ÕëÀàÐͲ»ÉõÀí½â£¬Òò´ËÔÚʹÓÃÉϳöÏÖÁËһЩ´íÎó¡£±¾ÎĽ«¶Ôvoid¹Ø¼ü×ÖµÄÉî¿Ìº¬Òå½øÐнâ˵£¬²¢ÏêÊövoid¼°voidÖ¸ÕëÀàÐ͵ÄʹÓ÷½·¨Óë¼¼ÇÉ¡£
2.voidµÄº¬Òå
voidµÄ×ÖÃæÒâ˼ÊÇ“ÎÞÀàÐÍ”£¬void *ÔòΪ“ÎÞÀàÐÍÖ¸Õ딣¬void ......
µ±¶ÁÕßÓÐÒ»¶¨c/c++»ù´¡
ÍƼöµÄÔĶÁ˳Ðò:
level 1
´Ó<<essential c++>>¿ªÊ¼£¬¶ÌС¾«º·£¬¿ÉÒÔ¶Ôc++ÄܽøÒ»²½Á˽âÆäÌØÐÔ
ÒÔ<<c++ primer>>×÷×ÖµäºÍ¿ÎÍâ¶ÁÎÒòΪ̫ºñ²»¿ÉÄÜÒ»¿ÚÆø¿´Íê
level 2
È»ºó´Ó<<effective c++>>¿ªÊ¼×ªÖ°£¬ÕâÊÇÊ¥¾£¬Çë×ñÊØ10½ë£¬Òª¾³£¿´£¬Ã»Ê¾ÍÄÃÀ´··
......