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

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»ÐèÒª³ÌÐòÔ±À´Íê³É,²Ù×÷ϵͳ»á´úÌ


Ïà¹ØÎĵµ£º

¡¾×ª¡¿¡¾C\C++ÓïÑÔÈëÃÅƪ¡¿ ÉîÈëÖ¸Õë

ÔÙÉÏһƪ£¬ÎÒÃǽéÉÜÁË»ù±¾µ÷ÊÔ¡£Ö®Ç°Ò²ËµÁË£¬Ö®ËùÒ԰ѵ÷ÊÔ·ÅÔÚÇ°Ãæ½²ÊÇÒòΪºóÃæµÄÎÄÕ»ù±¾¶¼»áÓõ½µ÷ÊÔ¡£¹Û²ìÎÒÃǵijÌÐòµ½µ×·¢ÉúÁËʲô¡£ÈÃÎÒÃÇÄܹ»Ö±½ÓÃ÷Á˵Ŀ´Çå³þÎÊÌâµÄ±¾ÖÊ¡£±¾Æª½«ÉîÈëÒ»µã½éÉÜÖ¸ÕëÕâ¸öÈÃÎÞÊý³õѧÕßη¾åµÄ¶«Î÷¡£Ï£Íû´ó¼ÒÔÙ¿´Í걾ƪ֮ºóÄܶÔÖ¸ÕëÓÐеÄÈÏʶ£¬Ö®ºó²»ÔÙ¾åÅÂËü¡£¾õµÃËü¾ÍÄÇô»ØÊ¡£ÄÇÏÂÃæÎÒ ......

linux c ÕýÔò±í´ïʽ

×î½üÓÐÕâô¸öÐèÇó,
c¸ã¸ãÕýÔò,
±Ï¾¹Regular Expression soÇ¿´ó^_^
±ê×¼µÄCºÍC+
+
¶¼²»Ö§³ÖÕýÔò±í´ïʽ£¬µ«ÓÐһЩº¯Êý¿â¿ÉÒÔ¸¨ÖúC/
C+
+
³ÌÐòÔ±Íê³ÉÕâÒ»¹¦ÄÜ£¬ÆäÖÐ×îÖøÃûµÄµ±ÊýPhilip HazelµÄPerl-
Compatible Regular Expression¿â£¬Ðí¶àLinux·¢Ðа汾¶¼´øÓÐÕâ¸öº¯Êý¿â¡£
±àÒëÕýÔò±í´ïʽ
ΪÁËÌá¸ßЧÂÊ£¬ÔÚ½«Ò»¸ö× ......

Åú´¦Àí µ÷ÊÔC/C++ʱɾ³ýÎÞÓõÄÎļþ

@echo --------------------- ÓÃÓÚ¡¶Ò»¸ö²Ù×÷ϵͳµÄʵÏÖ¡·µÄ cmd ---------------------
@echo off
mode con cols=80 lines=60 ::Ç°Ò»¸öÊý×Ö»ò×ÖĸΪ±³¾°É«£¬ºóÒ»¸öÊý×Ö»òÕß×ÖĸΪǰ¾°É«£¬ÏÂÃæÊÇһЩÑÕÉ«¶ÔÓ¦µÄÊý×Ö»ò×Öĸ£º
::0£½ºÚ¡¢1£½À¶¡¢2£½ÂÌ¡¢3£½Ç³ÂÌ¡¢4£½ºì¡¢5£½×Ï¡¢6£½»Æ¡¢7=°×¡¢8=»Ò¡¢9=µ­À¶¡¢A£½µ ......

c ÓïÑÔÌõ¼þ±àÒë Ïê½â

Ô¤´¦Àí¹ý³ÌɨÃèÔ´´úÂ룬¶ÔÆä½øÐгõ²½µÄת»»£¬²úÉúеÄÔ´´úÂëÌṩ¸ø±àÒëÆ÷¡£¿É¼ûÔ¤´¦Àí¹ý³ÌÏÈÓÚ±àÒëÆ÷¶ÔÔ´´úÂë½øÐд¦Àí¡£
ÔÚCÓïÑÔÖУ¬²¢Ã»ÓÐÈκÎÄÚÔڵĻúÖÆÀ´Íê³ÉÈçÏÂһЩ¹¦ÄÜ£ºÔÚ±àÒëʱ°üº¬ÆäËûÔ´Îļþ¡¢¶¨Òåºê¡¢¸ù¾ÝÌõ¼þ¾ö¶¨±àÒëʱÊÇ·ñ°üº¬Ä³Ð©´úÂë¡£ÒªÍê³ÉÕâЩ¹¤×÷£¬¾ÍÐèҪʹÓÃÔ¤´¦Àí³ÌÐò¡£¾¡¹ÜÔÚÄ¿Ç°¾ø´ó¶àÊý±àÒëÆ÷¶¼°üº ......

Ò»¸öÓÐȤµÄc³ÌÐò

-------------------------
--------------------------------------
--------------------------------------
viki 2010.1.25 ÖÆ×÷ ³ÌÐòÀïµÄ´ð°¸ÎªY
===================================
³ÌÐò½øÈ¥ºó£¬ÏÈÊäÈë16¸öÊýÿ¸öÊý°´»Ø³µ¡£
È»ºóÉú³ÉÒ»¸ö4x4µÄÊý×飬
ÈùÛÖÚ˵³öÐÄÖÐÏëµÄÊýµÄÅÅÊý£¬
½Ó×ųÌÐò»á½«Õâ´®Êý×éµÄÐÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ