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Ù×÷ϵͳ»á·ÀÖ¹
Ïà¹ØÎĵµ£º
linux
ÏÂÓÃCʵÏÖ‘CAT’µÄ¹¦ÄÜ
#include<stdio.h>
int main(int argc,char *argv[]){
FILE *file;
char buf[1024],name[20];
int n;
if(argc != 2){
printf("wrong argument\n");
return 1;
}
file=fopen(argv[1],"r");
if(file==NULL){
printf("Cant't open!\n&quo ......
¡¡B/S½á¹¹£¬¼´Browser/Server(ä¯ÀÀÆ÷/·þÎñÆ÷
)½á¹¹£¬ÊÇËæ×Å
Internet¼¼ÊõµÄÐËÆ𣬶ÔC/S½á¹¹µÄÒ»Öֱ仯»òÕ߸ĽøµÄ½á¹¹¡£ÔÚÕâÖֽṹÏ£¬Óû§½çÃæÍêȫͨ¹ýWWWä¯ÀÀÆ÷ʵÏÖ£¬Ò»²¿·ÖÊÂÎñÂß¼ÔÚÇ°¶ËʵÏÖ£¬µ«ÊÇ
Ö÷ÒªÊÂÎñÂß¼ÔÚ·þÎñÆ÷
¶ËʵÏÖ£¬ÐγÉËùν
3-tier½á¹¹¡£B/S½á¹¹£¬Ö÷ÒªÊÇÀûÓÃÁ˲»¶Ï³ÉÊìµÄWWWä¯ÀÀÆ÷¼¼Êõ£¬½áºÏä¯ÀÀÆ÷µÄ ......
C±ê×¼ÖеÄI/O¿âÊÇÒ»¸ö±È½ÏÅÓ´óµÄ¿â£¬ÊµÏÖÒ²±È½Ï¸´ÔÓ¡£ÏÔÈ»I/O¿âµÄʵÏÖÊÇÒÀÀµÓÚ²Ù×÷ϵͳµÄ£¬²»Í¬µÄϵͳÉÏI/O¿âµÄʵÏÖ»úÀíÊDz»Ò»ÑùµÄ¡£glibcÖУ¬I/O¿âµÄºËÐÄʵÏÖÔÚlibioĿ¼Ï¡£ÓÐ4¸öÍ·Îļþlibio.h, iolibio.h, libioP.h, strfile.h, stdio.h£¬ÆäÖÐstdio.hÊǵ¼³öµÄ±ê×¼CÍ·Îļþ£¬ÆäÓ඼ÊÇÄÚ²¿ÊµÏÖ¡£ÕâÀï²¢² ......
9)LinuxÏÂC¿ª·¢¹¤¾ß½éÉÜ
LinuxµÄ·¢ÐаæÖаüº¬Á˺ܶàÈí¼þ¿ª·¢¹¤¾ß. ËüÃÇÖеĺܶàÊÇÓÃÓÚ C ºÍ C++Ó¦ÓóÌÐò¿ª·¢
µÄ. ±¾ÎĽéÉÜÁËÔÚ Linux ÏÂÄÜÓÃÓÚ C Ó¦ÓóÌÐò¿ª·¢ºÍµ÷ÊԵŤ¾ß. ±¾ÎĵÄÖ÷Ö¼ÊǽéÉÜÈç
ºÎÔÚ Linux ÏÂʹÓà C ±àÒëÆ÷ºÍÆäËû C ±à³Ì¹¤¾ß, ¶ø·Ç C ÓïÑÔ±à³ÌµÄ½Ì³Ì.
GNU C ±àÒëÆ÷
GNU C ±àÒëÆ÷(GCC)ÊÇÒ»¸öÈ«¹¦Ä ......
JavaÓïÑÔ±¾Éí¾ßÓпçƽ̨ÐÔ£¬Èç¹ûͨ¹ýJavaµ÷ÓÃDLLµÄ¼¼Êõ·½±ãÒ×Óã¬Ê¹ÓÃJava¿ª·¢Ç°Ì¨½çÃæ¿ÉÒÔ¸ü¿ìËÙ£¬Ò²ÄÜ´øÀ´¿çƽ̨ÐÔ¡£
Javaµ÷ÓÃC/C++дºÃµÄDLL¿âʱ£¬ÓÉÓÚ»ù±¾Êý¾ÝÀàÐͲ»Í¬¡¢Ê¹ÓÃ×Ö½ÚÐòÁпÉÄÜÓвîÒ죬ËùÒÔÔÚ²ÎÊý´«µÝ¹ý³ÌÖÐÈÝÒ׳öÏÖÎÊÌ⣬DLLÖпÉÄÜÐèÒª×öÏàÓ¦µÄת»»¡£
ʹÓÃJavaµ÷ÓÃDLL¶¯Ì¬Á´½Ó¿âµÄ·½°¸Í¨³£ÓÐÈýÖÖ£ºJNI, Ja ......