dz̸CÄÚ´æ·ÖÅä1
¹ØÓÚCÓïÑÔÄÚ´æ·½ÃæµÄ»°ÌâÒªÕæ˵ÆðÀ´µÄ»°ÄÇ¿ÖžÍûͷÁË£¬ËùÒÔ±¾ÎĽö½öÊÇÒ»¸ödz̸¡£
¹ØÓÚÄÚ´æÎÊÌâ
²»Í¬Æ½Ì¨Ö®¼äÓÐÒ»¶¨µÄÇø±ð¡£±¾ÎÄËùÖ¸µÄƽ̨ÊÇx86µÄLinux
ƽ̨
ÓÃCÓïÑÔ×ö³ÌÐò£¨ÆäʵÆäËûÓïÑÔÒ²Ò»Ñù£©£¬²»½öÒªÊìϤÓï·¨£¬ÆäʵºÜ¶àÏà¹ØµÄ±³¾°ÖªÊ¶Ò²ºÜÖØÒª¡£ÔÚѧϰºÍÑо¿CÓïÑÔÖÐÄÚ´æ·ÖÅäµÄÎÊÌâÇ°£¬Ê×ÏÈÒªÁ˽âÒ»ÏÂLinux·ÖÅä¸ø½ø³Ì£¨ÔËÐÐÖеijÌÐò£©µÄµØÖ·¿Õ¼äÊÇʲôÑùµÄ¡£
×ܵÄÀ´ËµÓÐ3¸ö¶Î£¬¼´´úÂë¶Î£¬Êý¾Ý¶ÎºÍ¶ÑÕ»¶Î£¨Ñ§¹ý»ã±àµÄÅóÓÑÒ»¶¨ºÜÊìϤÁË£©¡£´úÂë¶Î¾ÍÊÇ´æ´¢³ÌÐòÎı¾µÄ£¬ËùÒÔÓÐʱºòÒ²½Ð×öÎı¾¶Î£¬Ö¸ÁîÖ¸ÕëÖеÄÖ¸Áî¾ÍÊÇ
´ÓÕâÀïÈ¡µÃ¡£Õâ¸ö¶ÎÒ»°ãÊÇ¿ÉÒÔ±»¹²ÏíµÄ£¬±ÈÈçÄãÔÚLinux¿ªÁË2¸öViÀ´±à¼Îı¾£¬ÄÇôһ°ãÀ´ËµÕâÁ½¸öViÊǹ²ÏíÒ»¸ö´úÂë¶ÎµÄ£¬µ«ÊÇÊý¾Ý¶Î²»Í¬£¨ÕâµãÓÐ
µãÀàËÆC++ÖÐÀàµÄ²»Í¬¶ÔÏó¹²ÏíÏàͬ³ÉÔ±º¯Êý£©¡£Êý¾Ý¶ÎÊÇ´æ´¢Êý¾ÝÓõģ¬»¹¿ÉÒԷֳɳõʼ»¯Îª·ÇÁãµÄÊý¾ÝÇø£¬BSS£¬ºÍ¶Ñ(Heap)Èý¸öÇøÓò¡£³õʼ»¯·ÇÁã
Êý¾ÝÇøÓòÒ»°ã´æ·Å¾²Ì¬·ÇÁãÊý¾ÝºÍÈ«¾ÖµÄ·ÇÁãÊý¾Ý¡£BSSÊÇBlock Started by
SymbolµÄËõд£¬Ô±¾ÊÇ»ã±àÓïÑÔÖеÄÊõÓï¡£¸ÃÇøÓòÖ÷Òª´æ·Åδ³õʼ»¯µÄÈ«¾ÖÊý¾ÝºÍ¾²Ì¬Êý¾Ý¡£»¹ÓоÍÊǶÑÁË£¬Õâ¸öÇøÓòÊǸø¶¯Ì¬·ÖÅäÄÚ´æÊÇʹÓõģ¬Ò²¾ÍÊÇÓÃ
mallocµÈº¯Êý·ÖÅäµÄÄÚ´æ¾ÍÊÇÔÚÕâ¸öÇøÓòÀïµÄ¡£ËüµÄµØÖ·ÊÇÏòÉÏÔö³¤µÄ¡£×îºóÒ»¸ö¶ÑÕ»¶Î£¨×¢Ò⣬¶ÑÕ»ÊÇStack,¶ÑÊÇHeap£¬²»ÊÇͬһ¸ö¶«Î÷£©£¬¶Ñ
Õ»¿ÉÌ«ÖØÒªÁË£¬ÕâÀï´æ·Åמֲ¿±äÁ¿ºÍº¯Êý²ÎÊýµÈÊý¾Ý¡£ÀýÈçµÝ¹éËã·¨¾ÍÊÇ¿¿Õ»ÊµÏֵġ£Õ»µÄµØÖ·ÊÇÏòÏÂÔö³¤µÄ¡£¾ßÌåÈçÏ£º
========¸ßµØÖ· =======
³ÌÐòÕ» ¶ÑÕ»¶Î
ÏòÏÂÔö³¤
“¿Õ¶´” =======
ÏòÉÏÔö³¤
¶Ñ
------ Êý¾Ý¶Î
BSS
------
·ÇÁãÊý¾Ý
=========µÍµØÖ· =======
========= =======
´úÂë ´úÂë¶Î
========= =======
ÐèҪעÒâµÄÊÇ£¬´úÂë¶ÎºÍÊý¾Ý¶ÎÖ®¼äÓÐÃ÷È·µÄ·Ö¸ô£¬µ«ÊÇÊý¾Ý¶ÎºÍ¶ÑÕ»¶ÎÖ®¼äûÓУ¬¶øÇÒÕ»ÊÇÏòÏÂÔö³¤£¬¶ÑÊÇÏòÉÏÔö³¤µÄ£¬Òò´ËÀíÂÛÉÏÀ´Ëµ¶ÑºÍÕ»»á“Ôö³¤µ½Ò»Æ𔣬µ«ÊDzÙ×÷ϵͳ»á·ÀÖ¹
Ïà¹ØÎĵµ£º
/********************************************************************
*ɾ³ýC/C++×¢ÊÍ
**********************************************************************/
#include <stdio.h>
//×¢Òâ
//1.¶Ô/****/µÄ´¦Àí
//2.Òª±£ÁôË«ÒýºÅÖ®¼äµÄÄÚÈÝ£¬Èçchar* test = "/*i am not comment */";
//3.¶ÔÓ ......
¡¡B/S½á¹¹£¬¼´Browser/Server(ä¯ÀÀÆ÷/·þÎñÆ÷
)½á¹¹£¬ÊÇËæ×Å
Internet¼¼ÊõµÄÐËÆ𣬶ÔC/S½á¹¹µÄÒ»Öֱ仯»òÕ߸ĽøµÄ½á¹¹¡£ÔÚÕâÖֽṹÏ£¬Óû§½çÃæÍêȫͨ¹ýWWWä¯ÀÀÆ÷ʵÏÖ£¬Ò»²¿·ÖÊÂÎñÂß¼ÔÚÇ°¶ËʵÏÖ£¬µ«ÊÇ
Ö÷ÒªÊÂÎñÂß¼ÔÚ·þÎñÆ÷
¶ËʵÏÖ£¬ÐγÉËùν
3-tier½á¹¹¡£B/S½á¹¹£¬Ö÷ÒªÊÇÀûÓÃÁ˲»¶Ï³ÉÊìµÄWWWä¯ÀÀÆ÷¼¼Êõ£¬½áºÏä¯ÀÀÆ÷µÄ ......
ͨÓú¯Êý¿âÔÚÍ·Îļþstdlib.hÖÐÉùÃ÷£¬±È½ÏÅÓ´ó£¬Ö÷Òª·ÖΪÒÔϼ¸´óÀࣺ´æ´¢·ÖÅä¡¢Ëæ»úÊýÉú³É¡¢Êý×Öת»»ÓëÕûÐÍÔËËã¡¢³ÌÐòÍ˳öÓë»·¾³Í¨ÐÅ¡¢ËÑË÷ÓëÅÅÐò¡¢¶à×Ö½ÚÓë¿í×Ö·ûµÄת»»¡£ÓÉÓÚ¼³¼°µ½´æ´¢·ÖÅä¡¢»·¾³Í¨Ðŵȣ¬Òò´ËËüÃǵĴó¶àÊýÒ²ÒÀÀµÓÚ²Ù×÷ϵͳ¡£glibcÖУ¬Í¨Óú¯Êý¿âµÄºËÐÄʵÏÖÔÚstdlibºÍmallocÁ½¸öĿ¼Ï ......
º¯Êý - ÉùÃ÷¡¢¶¨Òå¡¢µ÷ÓÃ
¡¡¡¡1. Èç¹ûº¯ÊýûÓÐÉùÃ÷, Ó¦¸ÃÔÚµ÷ÓÃÇ°¶¨Òå:
#include¡¡<stdio.h>
/*¡¡¶¨ÒåÇó´óÖµº¯Êý¡¡*/
int¡¡MAX(int¡¡x,¡¡int¡¡y)¡¡{
¡¡¡¡if¡¡(x¡¡>¡¡y)
¡¡¡¡¡¡¡¡return¡¡x;
¡¡¡¡else
¡¡¡¡¡¡¡¡return¡¡y;
}¡¡
/*¡¡¶¨ÒåÇóСֵº¯Êý¡¡*/
int¡¡MIN(int¡¡x,¡¡int¡¡y)¡¡{
¡¡¡¡return¡¡x¡¡&l ......
ÄÚ´æ·ÖÅ䷽ʽÓÐÈýÖÖ£º
£¨1£© ´Ó¾²Ì¬´æ´¢ÇøÓò·ÖÅä¡£ÄÚ´æÔÚ³ÌÐò±àÒëµÄʱºò¾ÍÒѾ·ÖÅäºÃ£¬Õâ¿éÄÚ´æÔÚ³ÌÐòµÄ
Õû¸öÔËÐÐÆڼ䶼´æÔÚ¡£ÀýÈçÈ«¾Ö±äÁ¿£¬static ±äÁ¿¡£
£¨2£© ÔÚÕ»ÉÏ´´½¨¡£ÔÚÖ´Ðк¯Êýʱ£¬º¯ÊýÄÚ¾Ö²¿±äÁ¿µÄ´æ´¢µ¥Ôª¶¼¿ÉÒÔÔÚÕ»ÉÏ´´½¨£¬º¯
ÊýÖ´ÐнáÊøʱÕâЩ´æ´¢µ¥Ôª×Ô¶¯±»ÊÍ·Å¡£Õ»ÄÚ´æ·ÖÅäÔËËãÄÚÖÃÓÚ´¦ÀíÆ÷µ ......