CµÄ¶¯Ì¬ÄÚ´æ¹ÜÀí mallac()ºÍfree()
¹ØÓÚcµÄ¶¯Ì¬ÄÚ´æ¹ÜÀíÒ»Ö±ÊǸö¾¾Ã²»Ë¥µÄ»°Ìâ,ÃæÊÔÒ²ÊÇ»ù±¾É϶¼»á¿¼µÄ,±¾À´¸Ð¾õÒѾÃ÷°×ÁË,µ«ÊǽñÌìʹÓõÄʱºòÒ»²»Ð¡Ðĵ¼Ö³ÌÐò±ÀÀ£ÁË,Òò´ËÉîÈëµÄÈ¥²éÁËÏÂ×ÊÁÏ,ÊÕ»ñ²»ÉÙ...Ìù³öÀ´Óë´ó¼Ò·ÖÏí...
ÏÈÌù¸ö´íÎó´úÂë:
int * ptr = (int *)malloc(256);
ptr = ptr + 3;//¶ÔÖ¸Õë½øÐÐÒ»¸öÆ«ÒƲÙ×÷
free(ptr);
Õâ¾ÍÊÇÒ»¶Î´íÎó´úÂë..?ÏàÐÅÒѾÓÐÈË¿´³öÀ´´íÎóÔÚÄÄÀïÁË...Èç¹û²»Ã÷°×µÄ¼ÌÐøÍùÏÂÃæ¿´...
ÏȾÍÕâ¸ö´íÎó½²½âÒ»ÏÂ,free(ptr)º¯ÊýÊÍ·ÅÄÚ´æµÄʱºòÊÇÐèÒª´ÓÔÏÈmalloc()º¯Êý·ÖÅäµÄµØÖ·ÄÇ¿ªÊ¼ÊͷŵÄ,»òÕßÕâÑù˵,¶Ômalloc()µÄÄÚ´æ½øÐÐfree()²Ù×÷,ÊÇ´Óµ±Ç°µÄÖ¸ÕëÖ¸ÏòµÄµØÖ·¿ªÊ¼ÊÍ·ÅÓÐmalloc()º¯Êý·ÖÅäµÄ´óСµÄÒ»¿éÄÚ´æÇøÓò...Òò´Ë,ÕâÑù¾ÍÐèÒªÄãÔÚ½øÐÐfree²Ù×÷µÄʱºò,±£Ö¤Ö¸ÕëËùÖ¸ÏòµÄλÖû¹ÊÇÓÐmalloc()·ÖÅä³öÀ´µÄµØÖ·...ÄÇôÈç¹ûÄãÐèÒª¶Ômalloc()·ÖÅä³öÀ´µÄÄÚ´æÇøÓò½øÐвÙ×÷µÄ»°...¾ÍÏóÏÂÃæÕâÑù...×ö¸öµØÖ·±¸·Ý...
int * ptr = ( int *)malloc(256);
int * str = ptr;
str = str + 3;
free(ptr);//ÕâÑùÄãÊͷžͲ»»áÓÐÎÊÌâÁË,Ò²±ÜÃâÁËÄÚ´æй©.
OK,ÉÏÃæµÄÎÊÌâºÍÔÀí»ù±¾ÉÏÒѾ˵ÇåÁË,ËäÈ»ÓеãÈƹþ...ÏÂÃæÊǹØÓÚCµÄ¶¯Ì¬ÄÚ´æ¹ÜÀíµÄһЩÉÔ΢ÉîÈëµãµÄ֪ʶ,ÓÐÐèÒªµÄ¿ÉÒÔ¿´¿´...
malloc()·ÖÅäµÄÄÚ´æ,ʵ¼ÊÉÏÊÇ·ÖÅäµÄ¶ÑÉÏÃæµÄÄÚ´æ,Ò²¾ÍÊÇ˵,Äãµ÷ÓÃmalloc()º¯Êýºó,malloc()·µ»Ø¸øÄãµÄÊÇÒ»¸ö¶ÑÉÏÃæÄÚ´æµÄÖ¸Õë,¶ÑÊÇ´ó¼Ò¹²ÓеÄÄÚ´æ¿Õ¼ä,·ÖΪȫ¾Ö¶ÑºÍ¾Ö²¿¶Ñ,¾Ö²¿¶ÑÄؾÍÊÇÓû§ÒѾ·ÖÅäÁ˵Ķѿռä,È«¾Ö¶Ñ×ÔÈ»¾ÍÊÇ»¹Ã»ÓзÖÅäµÄ¶Ñ¿Õ¼äÁË.¶ÑÊÇÔÚ²Ù×÷ϵͳ¶Ô½ø³Ì³õʼ»¯µÄʱºò·ÖÅäµÄ,ÄãÔÚ³ÌÐòÖ´ÐеĹý³ÌÖÐ,ÄãÒ²¿ÉÒÔ¼ÌÐøÉêÇëеĶѿռä,µ«ÊÇÐèÒªÓÃÍêºó¹é»¹¸ø²Ù×÷ϵͳ,²»È»¾ÍÊÇËùνµÄÄÚ´æй©ÁË...
ÄÇôջÔòÊÇÏ̶߳ÀÓеÄ,ÓÃÀ´±£´æ³ÌÐòµÄ¾Ö²¿±äÁ¿ºÍÔËÐÐ״̬µÄ,ÔÚÏ߳̿ªÊ¼µÄʱºò½øÐгõʼ»¯,ÿ¸öÏ̵߳ÄÕ»Ï໥¶ÀÁ¢,ËٶȺܿì,µ«ÊÇÈÝÁ¿ºÜС,¼ÈÈ»ÊÇÓÃÀ´±£´æ¾Ö²¿±äÁ¿,ÄÇô¿Ï¶¨Ã¿¸öº¯Êý¶¼ÓÐ×Ô¼ºµÄÕ»,Õ»±»ÓÃÀ´ÔÚº¯ÊýÖ®¼ä´«µÝ²ÎÊý,²Ù×÷ϵͳÇл»Ï̵߳Äʱºò»á×Ô¶¯Çл»Õ»¿Õ¼ä,¶øÇÒ,Ôڸ߼¶ÓïÑÔÖÐ,Õ»µÄ·ÖÅäºÍÊÍ·ÅÊDz»ÐèÒª³ÌÐòÔ±À´Íê³É,²Ù×÷ϵͳ»á´úÌ
Ïà¹ØÎĵµ£º
ÔÙÉÏһƪ£¬ÎÒÃǽéÉÜÁË»ù±¾µ÷ÊÔ¡£Ö®Ç°Ò²ËµÁË£¬Ö®ËùÒ԰ѵ÷ÊÔ·ÅÔÚÇ°Ãæ½²ÊÇÒòΪºóÃæµÄÎÄÕ»ù±¾¶¼»áÓõ½µ÷ÊÔ¡£¹Û²ìÎÒÃǵijÌÐòµ½µ×·¢ÉúÁËʲô¡£ÈÃÎÒÃÇÄܹ»Ö±½ÓÃ÷Á˵Ŀ´Çå³þÎÊÌâµÄ±¾ÖÊ¡£±¾Æª½«ÉîÈëÒ»µã½éÉÜÖ¸ÕëÕâ¸öÈÃÎÞÊý³õѧÕßη¾åµÄ¶«Î÷¡£Ï£Íû´ó¼ÒÔÙ¿´Í걾ƪ֮ºóÄܶÔÖ¸ÕëÓÐеÄÈÏʶ£¬Ö®ºó²»ÔÙ¾åÅÂËü¡£¾õµÃËü¾ÍÄÇô»ØÊ¡£ÄÇÏÂÃæÎÒ ......
×î½üÓÐÕâô¸öÐèÇó,
c¸ã¸ãÕýÔò,
±Ï¾¹Regular Expression soÇ¿´ó^_^
±ê×¼µÄCºÍC+
+
¶¼²»Ö§³ÖÕýÔò±í´ïʽ£¬µ«ÓÐһЩº¯Êý¿â¿ÉÒÔ¸¨ÖúC/
C+
+
³ÌÐòÔ±Íê³ÉÕâÒ»¹¦ÄÜ£¬ÆäÖÐ×îÖøÃûµÄµ±ÊýPhilip HazelµÄPerl-
Compatible Regular Expression¿â£¬Ðí¶àLinux·¢Ðа汾¶¼´øÓÐÕâ¸öº¯Êý¿â¡£
±àÒëÕýÔò±í´ïʽ
ΪÁËÌá¸ßЧÂÊ£¬ÔÚ½«Ò»¸ö× ......
@echo --------------------- ÓÃÓÚ¡¶Ò»¸ö²Ù×÷ϵͳµÄʵÏÖ¡·µÄ cmd ---------------------
@echo off
mode con cols=80 lines=60 ::Ç°Ò»¸öÊý×Ö»ò×ÖĸΪ±³¾°É«£¬ºóÒ»¸öÊý×Ö»òÕß×ÖĸΪǰ¾°É«£¬ÏÂÃæÊÇһЩÑÕÉ«¶ÔÓ¦µÄÊý×Ö»ò×Öĸ£º
::0£½ºÚ¡¢1£½À¶¡¢2£½ÂÌ¡¢3£½Ç³ÂÌ¡¢4£½ºì¡¢5£½×Ï¡¢6£½»Æ¡¢7=°×¡¢8=»Ò¡¢9=µÀ¶¡¢A£½µ ......
Ô¤´¦Àí¹ý³ÌɨÃèÔ´´úÂ룬¶ÔÆä½øÐгõ²½µÄת»»£¬²úÉúеÄÔ´´úÂëÌṩ¸ø±àÒëÆ÷¡£¿É¼ûÔ¤´¦Àí¹ý³ÌÏÈÓÚ±àÒëÆ÷¶ÔÔ´´úÂë½øÐд¦Àí¡£
ÔÚCÓïÑÔÖУ¬²¢Ã»ÓÐÈκÎÄÚÔڵĻúÖÆÀ´Íê³ÉÈçÏÂһЩ¹¦ÄÜ£ºÔÚ±àÒëʱ°üº¬ÆäËûÔ´Îļþ¡¢¶¨Òåºê¡¢¸ù¾ÝÌõ¼þ¾ö¶¨±àÒëʱÊÇ·ñ°üº¬Ä³Ð©´úÂë¡£ÒªÍê³ÉÕâЩ¹¤×÷£¬¾ÍÐèҪʹÓÃÔ¤´¦Àí³ÌÐò¡£¾¡¹ÜÔÚÄ¿Ç°¾ø´ó¶àÊý±àÒëÆ÷¶¼°üº ......
-------------------------
--------------------------------------
--------------------------------------
viki 2010.1.25 ÖÆ×÷ ³ÌÐòÀïµÄ´ð°¸ÎªY
===================================
³ÌÐò½øÈ¥ºó£¬ÏÈÊäÈë16¸öÊýÿ¸öÊý°´»Ø³µ¡£
È»ºóÉú³ÉÒ»¸ö4x4µÄÊý×飬
ÈùÛÖÚ˵³öÐÄÖÐÏëµÄÊýµÄÅÅÊý£¬
½Ó×ųÌÐò»á½«Õâ´®Êý×éµÄÐÐ ......