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

cÖ¸Õë

cÖ¸ÕëµÄÔËËãÓÐʱºò»¹ÊǺÜÃÔ»óÈ˵ġ£
ÀýÈ磺
struct student {
int num;
int score;
int length;
};
struct student *pt;
pt = (struct student *) malloc(sizeof(struct student));
pt->num = 1;
pt->score = 90;
pt->length = 3 * sizeof(int);
printf("pt length:%d\n", *pt);
pt = (int *)pt + 1;
printf("pt length:%d\n", *pt);
pt = (int *)pt + 1;Ö®ºóptµÄÀàÐÍ»¹ÊÇstruct student£¬³¤¶È»¹ÊÇ12¡£
Ç¿ÖÆת»»ÀàÐÍÔËËã·û()µÄ×÷ÓÃÊÇ£ºÉú³ÉÒ»¸öint *ÀàÐ͵Äpt£¬µ«ÊÇptÔ­À´µÄÀàÐÍ»¹ÊÇû±ä£¬
»»¾ä»°Ëµ¾ÍÊÇ£¬Ç¿ÖÆת»»ÀàÐÍÔËËã·ûÖ»ÔÚÔËËãʱÆð×÷Ó㬲¢²»Ó°ÏìÔ­À´µÄÖµ¡£


Ïà¹ØÎĵµ£º

LinuxÄں˴úÂë·ÖÎö slab.c by Áõ¿º


LinuxÄں˴úÂë·ÖÎö slab.c by Áõ¿º liukang@bjut.edu.cn
slab.cÀ´×ÔlinuxÄÚºË2.4.22°æ£¬±¾Îļþ°´ÕÕGNUЭÒé·¢²¼¡£
Ò»¡¢×¼±¸ÖªÊ¶£º
slabµÄ¸ÅÄ
Ìá³öµÄÔ­Òò£ºÓÉÓÚ²Ù×÷ϵͳÔÚÔËÐÐÖл᲻¶Ï²úÉú¡¢Ê¹Óá¢ÊÍ·Å´óÁ¿Öظ´µÄ¶ÔÏó£¬
ËùÒÔ¶ÔÕâÑùµÄÖظ´¶ÔÏóµÄÉú³É½øÐиĽø¿ÉÒÔ´ó´óÌá¸ßЧÂÊ
×îÔçÓÉsunµÄ¹¤³ÌʦÌá³ö(1994Äê)²¢Ê×ÏÈÔ ......

C/C++µ¥Ôª²âÊÔÀíÂÛ¾«Òª£¨Áù£©

2.1 ¿É²âÐÔÎÊÌâÏê½â(2)
   
    ½ÓÏÂÀ´ÎÒÃÇÌÖÂÛÖصãÎÊÌ⣺¸²¸ÇÊäÈë¡£Ò»¸öº¯Êý£¬ÊäÈë»áÓÐÄÄЩÄØ£¿ÊäÈë°üÀ¨Á½·½Ã棺ÍⲿÊäÈ룬ÄÚ²¿ÊäÈë¡£ÍⲿÊäÈëÈÝÒ×Àí½â£¬¾ÍÊǺ¯ÊýÍⲿ¿ÉÒÔÉ趨µÄÊäÈ룬°üÀ¨²ÎÊý£¬È«¾Ö±äÁ¿£¬³ÉÔ±±äÁ¿¡£
    
   
  &nb ......

C/C++±äÁ¿·ÖÎö


BSS
δ³õʼ»¯µÄÊý¾Ý
DATA
³õʼ»¯µÄÊý¾Ý
TEXT(code)
´úÂë
 
      ÔÚCÖÐÓÐÈ«¾Ö¡¢¾Ö²¿£¨×Ô¶¯±äÁ¿£©ºÍ¾²Ì¬±äÁ¿¡£
È«¾Ö±äÁ¿ÔÚCÓïÑÔÀï±íʾʱ£¬ÔÚº¯ÊýÖ®ÍâµÄ¾ÍÊÇÈ«¾Ö±äÁ¿£¬¼´ÔÚº¯ÊýÍâËùÉêÃ÷µÄ±äÁ¿£»¶ø¾²Ì¬±äÁ¿¿ÉÒÔ·ÅÔÚº¯ÊýÍ⣬Ҳ¿ÉÒÔ·ÅÔÚº¯ÊýÄÚ¡£È«¾Ö±äÁ¿ÓÐÁ½¸ö×÷Ó㺵ÚÒ»£¬µ±ÔÚº¯ÊýÍâÉê ......

Optimizing Your C/C++ Applications


C/C++ optimizing compilers are great--but there *are* a few techniques for hand-tuning your code to run as efficiently as possible on the AMD Athlon64 and Opteron processors, especially when developing DLLs, device drivers, or other performance-bound pieces of code.
Alan Zeichick  
Share | ......

C/C++ÖеÄ64λÕûÊý£¨__int64 and long long£©

¡¡¡¡ÔÚ×öACMÌâʱ£¬¾­³£¶¼»áÓöµ½Ò»Ð©±È½Ï´óµÄÕûÊý¡£¶ø³£ÓõÄÄÚÖÃÕûÊýÀàÐͳ£³£ÏÔµÃ̫СÁË£ºÆäÖÐlong ºÍ int
·¶Î§ÊÇ[-2^31,2^31)£¬¼´-2147483648~2147483647¡£¶øunsigned·¶Î§ÊÇ[0,2^32)£¬¼´
0~4294967295¡£Ò²¾ÍÊÇ˵£¬³£¹æµÄ32λÕûÊýÖ»Äܹ»´¦Àí40ÒÚÒÔϵÄÊý¡£
¡¡¡¡ÄÇÓöµ½±È40ÒÚÒª´óµÄÊýÔõô°ìÄØ£¿Õâʱ¾ÍÒªÓõ½C++µÄ64λÀ©Õ¹ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ