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

³ÌÐòÔ±µÄ×ÔÎÒÐÞÑø: ³ÌÐòÔËÐеĻùʯ C/C++ÔËÐпâ

Ò»¸öCÓïÑÔÔËÐпâ´óÖ°üº¬ÁËÈçϹ¦ÄÜ:
1. Æô¶¯ÓëÍ˳ö: °üÀ¨Èë¿Úº¯Êý¼°Èë¿Úº¯ÊýËùÒÀÀµµÄÆäËüº¯ÊýµÈ
2. ±ê×¼º¯Êý: ÓÉCÓïÑÔ±ê×¼¹æ¶¨µÄCÓïÑÔ±ê×¼¿âËùÓµÓеĺ¯ÊýʵÏÖ.
3. I/O: IO¹¦Äܵķâ×°ºÍʵÏÖ
4. ¶Ñ:¶ÑµÄ·â×°ºÍʵÏÖ
5. ÓïÑÔʵÏÖ: ÓïÑÔÖÐһЩÌØÊ⹦ÄܵÄʵÏÖ.
6. µ÷ÊÔ: ʵÏÖµ÷ÊÔ¹¦ÄܵĴúÂë.
ÔÚÕâЩÔËÐпâµÄ×é³É³É·ÖÖÐ, CÓïÑÔ±ê×¼Õ¼¾ÝÁËÖ÷Òª²¢ÇÒ´óÓÐÀ´Í·.
1. ±ä³¤²ÎÊý
º¯ÊýµÄʵÏÖÈçÏÂ:
#define _crt_va_start(ap,v) ( ap = (va_list)_ADDRESSOF(v) + _INTSIZEOF(v) )
//va_startÈ¡µÚÒ»¸ö²ÎÊýµÄµØÖ·, ²¢ÔÚÕ»ÉÏÏòÉÏÒƶ¯Ö¸Õë
#define _crt_va_arg(ap,t) ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
//va_argÖ÷ÒªÊÇÏÈÒƶ¯Ö¸Õë,ÔÙÈ¡ÉÏÒ»¸öÖµ.
//×¢Òâ: tÊÇÖ¸Òª´«ÈëµÄÀàÐÍ,ӦΪҪȷ¶¨Òƶ¯µÄÖ¸ÕëµÄÔ¶½ü.
#define _crt_va_end(ap) ( ap = (va_list)0 )
//ʹapÖ¸ÕëΪ0
//Ö÷ÒªÊÇÀûÓÃÕ»µÄÔ­Àí.

#include <stdio.h>
#include <stdarg.h>
int sum(int a, ...)
{
int v = 0;
va_list ap;
va_start(ap, a);
while(a--)
v += va_arg(ap, int);
va_end(ap);
return v;
}
int main()
{
printf("%d", sum(9, 1,2,3,4,5,6,7,8,9));
return 0;
}
2. ·Ç¾Ö²¿Ìøת
#include <setjmp.h>
jmp_buf b;
void f()
{
longjmp(b, 1);
}
int main()
{
if(setjmp(b))
printf("World!");
else
{
printf("Hello ");
f();
}
return 0;
}
½á¹û: Hello World!
µ±µ÷ÓÃlongjmpʱ,ÔËÐе½setjmp·µ»ØµÄλÖÃ,²¢°ÑsetjmpµÄ·µ»ØÉèÖÃΪ1
¹ØÓÚ²»Í¬°æ±¾CRTµÄÎÊÌâ
1. ΪʲôÓÃVC2008±àÒëµÄ³ÌÐòÎÞ·¨ÔÚ±ðÈ˵ĻúÆ÷ÉÏÔËÐÐ?
ÒòΪVC2008±àÒëµÄ³ÌÐòʹÓÃÁËmanifest»úÖÆ, ÕâЩ³ÌÐò±ØÐëÒÀÀµÓÚÏà¶ÔÓ¦°æ±¾µÄÔËÐпâ.
Ò»¸ö½â¾ö°ì·¨¾ÍÊÇʹÓþ²Ì¬Á´½Ó, ÕâÑù¾Í²»ÐèÒªÒÀÀµÓÚCRTµÄDLL.
ÁíÒ»°ì·¨Êǽ«ÏàÓ¦°æ±¾µÄÔËÐпâÓë³ÌÐòÒ»Æð·¢²¼¸ø×îÖÕÓû§.
2. Èç¹ûÒ»¸ö³ÌÐòÀïÃæµÄ²»Í¬objÎļþ»òdllÎļþʹÓÃÁ˲»Í¬µÄCRT, »á²»»áÓÐÎÊÌâ?
Èç¹ûÖ»ÓÐobjûÓÐdll, ÕâʱÊǾ²Ì¬Á´½Ó, ²»Í¬µÄobjÔÚ±àÒëʱÓõ½Á˲»Í¬°æ±¾µÄ¾²Ì¬CRT. Ò»°ãÊDz»»á³öÏÖÎÊÌâµÄ. ÒòΪĿ±êÎļþ¶Ô¾²Ì¬¿âÒýÓÃÖ»ÊÇÔÚÄ¿±êÎļþµÄ·ûºÅ±íÖб£ÁôÒ»¸ö¼ÇºÅ, ²»½øÐÐÁ´½Ó, ûÓо²Ì¬¿âµÄ°æ±¾ÐÅÏ¢.
µ«ÊÇÈç¹ûº¬Óв»Í¬°æ±¾µÄdllÎļþ, ÔòÓпÉÄܳöÏÖÎÊÌâ.


Ïà¹ØÎĵµ£º

C/C++ÓïÑÔʵÏÖ¶¯Ì¬Êý×é

C/C++ÓïÑÔʵÏÖ¶¯Ì¬Êý×é
CÊý×éµÄСÎÊÌâ
     ÕâÀï˵µÄ¶¯Ì¬Êý×éÊÇ¿ÉÒÔ¸ù¾ÝÐèÒª¶¯Ì¬Ôö³¤Õ¼ÓÃÄÚ´æµÄÊý×飬±ÈÈç³ÌÐò³õʼ·ÖÅäÁË100¸öÔªËØ£¬¿ÉÊÇÔËÐÐÁËÒ»¶Îʱ¼äºóÇøÇø100¸ö¿Õ¼ä²»ÄÜÂú×ãÁË£¬ÏÖÔÚÐèÒª400¸ö£¬Ôõô°ìÄØ£»Äǿ϶¨ÐèÒªÔÙ¶îÍâ·ÖÅä300¸ö¡£
     CÓïÑÔÓÐrealloc()º¯ÊýÀ´½â¾ö¿Õ¼ä ......

תÔØ: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, ......

C/C++ ºêÏê½â

http://demonstyle.blog.163.com/blog/static/13143429020091010112159/
C/C++ ºêÏê½â
ic/c++ 2009-11-10 01:12:15 ÔĶÁ18 ÆÀÂÛ0 ×ֺţº´óÖÐС
ÖÚ¶àC++Êé¼®¶¼ÖÒ¸æÎÒÃÇCÓïÑÔºêÊÇÍò¶ñÖ®Ê×£¬µ«ÊÂÇé×ܲ»ÈçÎÒÃÇÏëÏóµÄÄÇô»µ£¬¾ÍÈçͬgotoÒ»Ñù¡£ºêÓÐ
Ò»¸öºÜ´óµÄ×÷Ó㬾ÍÊÇ×Ô¶¯ÎªÎÒÃDzúÉú´úÂë¡£Èç¹û˵ģ°å¿ÉÒÔΪÎÒÃDzúÉú¸÷ÖÖÐÍ ......

[ת]ubuntuÏÂc£¯c++¿ª·¢»·¾³ÅäÖÃ

ubuntuϵÄc/c++»·¾³´î½¨ÊDZȽϼòµ¥,ÒòΪÓÐaptºÍÐÂÁ¢µÃµÄ°ïÖú.
1.
Ê×ÏÈÊÇÅäÖÃgcc,ÔÚubuntu°²×°Íê³ÉÒѾ­ÓÐgccÁË(gccÊÇÓÉGNUÖ®¸¸StallmanËù¿ª·¢µÄlinuxϵıàÒëÆ÷£¬È«³ÆΪGNU
Compiler Collection£¬ Ä¿Ç°¿ÉÒÔ±àÒëµÄÓïÑÔ°üÀ¨£ºC, C++, Objective-C, Fortran, Java,
and
Ada.).µ«ÊÇgcc»¹²»ÄܱàÒëÎļþ.ÒòΪȱÉÙһЩͷÎļþ.Ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ