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

c/C++±àÒëµÄ³ÌÐòÕ¼ÓõÄÄÚ´æ

Ò»¸öÓÉc/C++±àÒëµÄ³ÌÐòÕ¼ÓõÄÄÚ´æ·ÖΪÒÔϼ¸¸ö²¿·Ö
1¡¢Õ»Çø£¨stack£©— ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å £¬´æ·Åº¯ÊýµÄ²ÎÊýÖµ£¬¾Ö²¿±äÁ¿µÄÖµµÈ¡£Æä²Ù×÷·½Ê½ÀàËÆÓÚÊý¾Ý½á¹¹ÖеÄÕ»¡£
2¡¢¶ÑÇø£¨heap£© — Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬ Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøʱ¿ÉÄÜÓÉOS»ØÊÕ ¡£×¢ÒâËüÓëÊý¾Ý½á¹¹ÖеĶÑÊÇÁ½»ØÊ£¬·ÖÅ䷽ʽµ¹ÊÇÀàËÆÓÚÁ´±í£¬ºÇºÇ¡£
3¡¢È«¾ÖÇø£¨¾²Ì¬Çø£©£¨static£©—£¬È«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿µÄ´æ´¢ÊÇ·ÅÔÚÒ»¿éµÄ£¬³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿ÔÚÒ»¿éÇøÓò£¬ δ³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍδ³õʼ»¯µÄ¾²Ì¬±äÁ¿ÔÚÏàÁÚµÄÁíÒ»¿éÇøÓò¡£ - ³ÌÐò½áÊøºóÓÐϵͳÊÍ·Å
4¡¢ÎÄ×Ö³£Á¿Çø —³£Á¿×Ö·û´®¾ÍÊÇ·ÅÔÚÕâÀïµÄ¡£ ³ÌÐò½áÊøºóÓÉϵͳÊÍ·Å
5¡¢³ÌÐò´úÂëÇø—´æ·Åº¯ÊýÌåµÄ¶þ½øÖÆ´úÂë¡£
È«¾Ö±äÁ¿ int (*myf)(int a) = my_Fun, my_FunÊÇÈ«¾Öº¯Êý
myf±£´æÔÚ(Õ» ), Ö¸ÏòµÄÄÚÈÝÔÚ(´úÂë¶Î )
  º¯ÊýÄÚ:static int a = 0; char *p = "abc";
a ±£´æÔÚ(¾²Ì¬Çø ), Ö¸ÏòµÄÄÚÈÝÔÚ(³£Á¿Çø )
  º¯ÊýÄÚ:char *ar = new char[4];
        ar ±£´æÔÚ( Õ»),Ö¸ÏòµÄÄÚÈÝÔÚ(¶Ñ )
1.ÊÇÒ»¸öº¯ÊýÖ¸Õë,ÔÚÕ»
2.Ò»¸öº¯Êý,ÔÚ´úÂëÇø
3.¾²Ì¬±äÁ¿,ÔÚ¾²Ì¬Çø
4.×Ö·û³£Á¿,ÔÚ³£Á¿Çø
5.×Ö·ûÖ¸Õë,ÔÚÕ»
6.¶¯Ì¬ÉêÇëÄÚ´æ,ÔÚ¶Ñ


Ïà¹ØÎĵµ£º

תÔØ:Hadoop Ó¦¸ÃÓÃC++ʵÏÖ£¬¶ø²»ÊÇJava

http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html
Sunday, May 10, 2009
Hadoop should target C++/LLVM, not Java (because of watts)
< type="text/javascript">
digg_url="http://www.trendcaller.com/2009/05/hadoop-should-target-cllvm-not-java.html";
Over the years, ......

ÈçºÎÔÚunixµÄc³ÌÐòÖеõ½system()µ÷Óõķµ»ØÖµ

½áÂÛ£º
char cmd[128];
...
int  status = system(cmd);
printf("%d == system(\"%s\");\n", WEXITSTATUS(status), cmd);  //´òÓ¡·µ»ØÖµ
 
ÍøÉÏËѵ½µÄ´ð°¸Óë½âÊÍ(1)£º
http://www.lslnet.com/linux/dosc1/38/linux-280268.htm
ÈçºÎÔÚunix c³ÌÐòÖеõ½systemµ÷Óõķµ»ØÖµ,ÇëÖ¸½Ì
¶Ô system µÄ·µ»ØÖµ ......

ubuntuϱàÒëc/c++

ÈôÏëÔÚubuntuϱàÒëc/c++´úÂë
Ê×ÏÈ£¬°²×°g++ºÍgdb£¬¿ÉÒÔÔÚÐÂÁ¢µÃÖÐÖ±½Ó°²×°
ÈôÒª±àÒëc£¬È磺
££include
<stdio.h>
int main()
{
   
printf("Hello,World!\n");
    return 0;

}




......

linuxÉÏcÓïÑÔ »ñµÃÍøÂç½Ó¿ÚµÄͳ¼ÆÖµ

Õâ¸ö¶«¶«£¬ÂùºÃÍæµÄ¡£Æäʵ¾ÍÊǶÁÈ¡ÁË/proc/net/dev Îļþ¡£
struct netdev_stats {
    unsigned long long rx_packets_m;    /* total packets received       */
    unsigned long long tx_packets_m;     &nbs ......

×Ô¼ºÊÜÁ˵ã´Ì¼¤ JavaÄܹ»Ìæ´úCÓïÑÔÂð£¿


ÎÒ²»ÖªµÀÕâƪÎÄÕµÄ×÷ÕßÊÇË­£¬µ«ÎÒÖªµÀ£¬Ëû¶ÔjavaÓÐÒ»ÖÖºÜÉîµÄÀí½â£¬ÆäʵÎÄÕÂÖв¢Ã»ÓÐÌåÏÖ³ö×÷Õ߶Ôjava¼¼ÊõÉî²ãÀí½â£¬µ«ÊÇ´ÓÎÄÖеÄÿһ¾ä»°ÖУ¬ÎÒ¸ÐÊܵ½ÁËһЩ¶«Î÷¡£ÕâÊÇһƪºÜºÃµÄÎÄÕ£¬Ò²¿ÉÒÔ°ïÖúºÜ¶àÈËÃÔãµÄÈ˽â¾öÎÊÌâ¡£´øÀ´ºÍ´ó¼Ò·ÖÏíһϡ£
Ç°²»¾ÃCSDN¿¯µÇÁËһƪ¡¶CÓïÑÔÒѾ­ËÀÁË¡·µÄÎÄÕ£¬ÒýÆðÁËһЩÕùÂÛ¡£ÆäʵÄÇÆ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ