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

DS¼Æ»®CÉîÈëÏîĿѧϰ×ܽᗗ±äÁ¿µÄ×÷ÓÃÓò

1.1 ±äÁ¿×÷ÓÃÓò
1.1.1 ¼¸ÖÖ³£¼ûÀàÐͱäÁ¿µÄ×÷ÓÃÓò
×÷ÓÃÓò£¨scope£©»òÕ߿ɼûÐÔÊÇÖ¸±äÁ¿ÔÚ³ÌÐòÄڵĿɼûºÍ¿ÉÒýÓõķ¶Î§¡£
±ÈÈç:
1¡¢ È«¾Ö±äÁ¿ÔÚËùÓеÄÎļþ¶¼¿É¼û£¬ÄÇËûµÄ×÷ÓÃÓò¾ÍÊÇËùÓÐÎļþ£»
2¡¢ static¶¨ÒåµÄÈ«¾Ö±äÁ¿£¬Ö»ÔÚ¶¨ÒåËüµÄÔ´ÎļþÖпɼû£¬ÄÇËûµÄ×÷ÓÃÓò¾ÍÊÇÆäËùÔÚµÄÔ´Îļþ£»
3¡¢ º¯ÊýÄÚ²¿µÄ¾Ö²¿±äÁ¿£¬Ö»ÔÚÆ亯Êý·¶Î§Äڿɼû£»
4¡¢ ÓÐЩ±äÁ¿£¬Ö»ÔÚijһ¿é´úÂë¶ÎÄڿɼû£¨»¨À¨ºÅÀ¨ÆðÀ´µÄÒ»¶Î´úÂ룩£»
void test_fun()
{
int test_i = 0;
test_i = 10;
if (test_i != 0)
{
int test_count = 15;
test_i = test_count;
}
test_i = test_count;//ÕâÀï»á±àÒë³ö´í£¬ÒòΪtest_countÖ»ÔÚifÌõ¼þµÄ»¨À¨ºÅÖÐÓÐЧ¡£
}
1.1.2 ±äÁ¿Ê¹Óõĸ߼¶»°Ìâ
ÏÂÃæ´ó²¿·ÖÄÚÈÝÀ´×Ô¡¶´úÂë´óÈ«¡·¡£
1.1.2.1  ʹ±äÁ¿ÒýÓþֲ¿»¯
¡¶´úÂë´óÈ«¡·Õâ±¾Êé½éÉÜÁ˹¥»÷´°¿ÚµÄ¸ÅÄ½éÓÚͬһ¸ö±äÁ¿¶à¸öÒýÓõãÖ®¼äµÄ´úÂë¿É³ÉΪ¹¥»÷´°¿Ú£¬ÔÚÕâ¸ö´°¿ÚÖÐÐÂÔö´úÂ룬¿ÉÄܻ᲻µ±µÄÐ޸Ĵ˱äÁ¿¡£
Ò»°ã¶øÑÔ£¬°Ñ¶ÔÒ»¸ö±äÁ¿µÄÒýÓþֲ¿»¯£¬¼´°ÑÒýÓõ㾡¿ÉÄܼ¯ÖÐÔÚÒ»Æð×ÜÊÇÒ»ÖֺܺõÄ×ö·¨¡£Ö÷ÒªµÄºÃ´¦ÊÇÌá¸ß³ÌÐòµÄ¿É¶ÁÐԺͿÉά»¤ÐÔ¡£Èç¹û±äÁ¿µÄÒýÓõ㶼ºÜ¼¯ÖУ¬ÔòÔĶÁ´úÂëµÄʱºò£¬Ö»Òª¹Ø×¢ÕâÒ»¿é´úÂë¾Í¿ÉÒÔÁË£¬·ñÔò£¬ÔĶÁÕßµÄÄ¿¹âÐèÒªÔÚ´úÂëÖÐÌøÀ´ÌøÈ¥¡£
ÈçºÎºâÁ¿±äÁ¿ÒýÓõļ¯Öг̶ȣ¿¡¶´úÂë´óÈ«¡·Ìáµ½Á˱äÁ¿¿ç¶ÈµÄ¸ÅÄ¶Ô±äÁ¿ËùÓÐÒýÓüäÏà¸ôµÄ´úÂëÐÐÊý¡£
void test_fun()
{
int test_i = 0;
int test_j = 0;
test_i = 10;//ºÍµÚÒ»´ÎÒýÓüä¸ô1ÐдúÂë
if (test_i != 0)//ºÍµÚ¶þ´ÎÒýÓüä¸ô0ÐдúÂë
{
int test_count = 15;
test_i = test_count;//ºÍµÚÈý´ÎÒýÓüä¸ô1ÐдúÂë
}
}
test_iµÄ¿ç¶È×ܹ²ÊÇ2¡£test_iµÄƽ¾ù¿ç¶ÈÊÇ2/3¡£
1.1.2.2  Ëõ¶Ì±äÁ¿µÄ´æ»îʱ¼ä
±äÁ¿µÄ´æ»îʱ¼ä—— Ò»¸ö±äÁ¿´æÔÚÆÚ¼äËù¿çÔ½µÄÓï¾ä×ÜÊý¡£Ò²¾ÍÊÇ´ÓµÚÒ»´ÎÒýÓ㬵½×îºóÒ»´ÎÒýÓÃÖ®¼ä¿çÔ½´úÂëµÄÐÐÊý¡£
¿ç¶È±íÃ÷±äÁ¿ÒýÓõļ¯Öг̶ȣ¬´æ»îʱ¼ä±íÃ÷±äÁ¿¾­ÀúµÄÓï¾ä¡£
ÈçÉÏͼËùʾ£¬test_i´æ»îʱ¼äÊÇ6ÌõÓï¾ä¡£
µÍ´æ»îʱ¼äµÄºÃ´¦£º
1¡¢¼õС¹¥»÷´°¿Ú£¬²»Ò׳ö´í¡£
2¡¢Ê¹Äã¶Ô´úÂëÓиü׼ȷµÄÈÏʶ£¨Ìá¸ß¿É¶ÁÐÔ£©
3¡¢¼õÉÙ³õʼ»¯´íÎó¡£
×îºó£¬Ò»¸öÃ÷ÏԵĺô¦ÊDZãÓÚ³ÌÐòÖع¹£¬Èç¹ûÒ»¸ö³ÌÐò²ð·ÖΪ¶à¸öСµÄ³ÌÐò£¬¶ÌµÄ´æ»îʱ¼ä¸üÓмÛÖµ¡£
Óÿç¶ÈºÍÉú´æʱ¼äÀ´¿¼²ìÈ«¾Ö±äÁ¿£¬»á·¢ÏÖÈ«¾Ö±äÁ¿¿ç¶ÈºÍÉú´æʱ¼ä¶¼ºÜ³¤——ÕâÊDZÜÃâʹÓÃÈ«¾Ö±äÁ¿µÄºÃµÄÀíÓÉÖ®Ò»¡£
1.1.2.3  ¼õС×÷Ó


Ïà¹ØÎĵµ£º

linux CʹÓùܵÀͨÐÅ£¨Ò»£©

 LinuxÖеĽø³ÌͨÐÅ
1.¹ÜµÀ
   º¯ÊýÔ­ÐÍ£ºint pipe(int filedes[2]);
   º¯Êý·µ»ØÖµ£º ÕýÈ··µ»Ø0£»´íÎó·µ»Ø-1
   ÆäÖеÄÎļþÃèÊö·ûfiledes[0]ÊÇÓÃÀ´¶ÁÈ¡Êý¾ÝµÄ£¬filedes[1]ÊÇÓÃÀ´Ð´Êý¾ÝµÄ¡£
Àý×Ó1£º
#include<stdio.h>
#include<stdlib.h>
#include<u ......

ÇåÀíCÅÌ´ó¹¥ÂÔ——Á¢¼´¼ûЧ


1.´ò¿ª“ÎҵĵçÄÔ”-“¹¤¾ß”-“Îļþ¼ÐÑ¡Ïî”-“²é¿´”-ÔÚ“ÏÔʾËùÓÐÎļþºÍÎļþ¼Ð”Ñ¡ÏîÇ°´ò¹´-“È·¶¨” 
2.ɾ³ýÒÔÏÂÎļþ¼ÐÖеÄÄÚÈÝ£º 
x:\\Documents and Settings\\Óû§Ãû\\Cookies\\ϵÄËùÓÐÎļþ(±£ÁôindexÎļþ) 
x:\\Documents and S ......

[ASM/C/C++]cÓïÑÔÖÐstatic Ó÷¨×ܽá

¼ÙÉèÔÚtest.hÖж¨ÒåÁËÒ»¸östatic bool g_test=false;
Èôtest1.cºÍtest2.c¶¼°üº¬test.h£¬Ôòtest1.cºÍtest2.c·Ö±ðÉú³ÉÁ½·Ýg_test£¬ÔÚtest1.c ÖÐÖÃg_test=true,¶øtest2.cÖÐÈÔȻΪfalse²¢Î´¸Ä±ä£¡shit£¡£¡
Ò»¡¢c³ÌÐò´æ´¢¿Õ¼ä²¼¾Ö
C³ÌÐòÒ»Ö±ÓÉÏÂÁв¿·Ö×é³É£º
      1£©ÕýÎĶΗ—CPUÖ´ÐÐ ......

¿¼²éǶÈëʽC¿ª·¢ÈËÔ±µÄ×îºÃµÄ0x10µÀÌâ

±àÕß°´
:·Ç³£»ù±¾¹ØÓÚCÓïÑÔµÄÎÊÌâ,Ò»¸öÐÅÏ¢Àà(¼ÆËã»ú,×ÊѶ¹¤³Ì,µç×Ó¹¤³Ì, ͨÐŹ¤³Ì)רҵµÄ±¾¿Æ±ÏÒµÉúÓ¦¸Ã´ïµ½µÄˮƽ¡£ÌâÄ¿²»ÄÑ,È«²¿¶¼ÄÜ¿ìËٵشðÍ꣬µ±È»Ò²ÐèÒªÒ»¶¨µÄ֪ʶ´¢±¸¡£
¶ÔÓÚ´ó¶àÊýÈË£¬ÎÒÃÇÔ¤ÆÚÄã¿ÉÄÜ´ð´í 3)   4)  15)Ì⣬ËùÒÔ´ð´í3µÀÒÔÄڵģ¬ÎÒÃÇÈÏΪÄãºÜ°ô
´ð´í5µÀÌâÒÔÄÚ£¬ÎÒÃÇÈÏΪÄ㻹²»´í(Ä ......

Ò»¸öLinuxÏÂCÏ̳߳صÄʵÏÖ

      ʲôʱºòÐèÒª´´½¨Ï̳߳ØÄØ£¿¼òµ¥µÄ˵£¬Èç¹ûÒ»¸öÓ¦ÓÃÐèҪƵ·±µÄ´´½¨ºÍÏú»ÙỊ̈߳¬¶øÈÎÎñÖ´ÐеÄʱ¼äÓַdz£¶Ì£¬ÕâÑùÏ̴߳´½¨ºÍÏú»ÙµÄ´øÀ´µÄ¿ªÏú¾Í²»ÈݺöÊÓ£¬ÕâʱҲÊÇÏ̳߳ظóö³¡µÄ»ú»áÁË¡£Èç¹ûÏ̴߳´½¨ºÍÏú»Ùʱ¼äÏà±ÈÈÎÎñÖ´ÐÐʱ¼ä¿ÉÒÔºöÂÔ²»¼Æ£¬ÔòûÓбØҪʹÓÃÏ̳߳ØÁË¡£
   ÏÂÃæÊÇ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ