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

C±ê×¼Ô¤¶¨Òåºê

ANSI C±ê×¼ÖÐÓм¸¸ö±ê×¼Ô¤¶¨Òåºê£º__FILE__     __DATE__   __TIME___    __LINE__   µÈ
__LINE__£ºÔÚÔ´´úÂëÖвåÈ뵱ǰԴ´úÂëÐкţ»
__FILE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰԴÎļþÃû£»
__DATE__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰµÄ±àÒëÈÕÆÚ
__TIME__£ºÔÚÔ´ÎļþÖвåÈ뵱ǰ±àÒëʱ¼ä£»
__STDC__£ºµ±ÒªÇó³ÌÐòÑϸñ×ñÑ­ANSI C±ê׼ʱ¸Ã±êʶ±»¸³ÖµÎª1£»
__cplusplus£ºµ±±àдC++³ÌÐòʱ¸Ã±êʶ·û±»¶¨Òå¡£
Õ⼸¸öºê±È½ÏÓÐÓá«¡«¡«¡«¡«¡«¡«¡«
ÔÚµ÷ÊÔ³ÌÐòʱ»ò±àÒëʱ£¬__LINE__±È½ÏÓÐÓ㬿ÉÒÔÓÃÀ´´òÓ¡Âß¼­´íÎóµÄÐкš«¡«¡«¡«¡«¡«¡«£¬Àý×Ó£º
switch(x)
{
         case 1:
                   ....;
                   break;
         case 2:
                   .....;
                  break;
          default:
            printf("logic erro line number%d!\n",__LINE__);
            break;
}
ÓÖÈçÀûÓÃ__DATE__ºÍ__TIME__¿ÉÒÔ²åÈë±àÒëʱ¼ä¡£
´úÂ룺
void print_version_info(void)
{
         printf("Date Compiled:%s\n",__DATE__);
         printf("TimeCompiled:%s\n",__TIME__);
}
Êä³ö¸ñʽΪ:mm dd yy ºÍ hh£ºmm£ºss
×÷Ó㺶ÔÓÚ__FILE__£¬__LINE__£¬__func__ÕâÑùµÄºê£¬ÔÚµ÷ÊÔ³ÌÐòʱÊǺÜÓÐÓõģ¬ÒòΪÄã¿ÉÒÔºÜÈÝÒ×µÄÖªµÀ³ÌÐòÔËÐе½ÁËÄĸöÎļþµÄÄÇÒ»
ÐУ¬ÊÇÄĸöº¯Êý¡£
      
ÏÂÃæÒ»¸öÀý×ÓÊÇ´òÓ¡ÉÏÃæÕâЩԤ¶¨ÒåµÄºêµÄ¡£
__DATE__,__FILE__,__LINE__,__TIME__,__FUNCTION__
C±ê×¼ÖÐ


Ïà¹ØÎĵµ£º

fork compare to exec in linux c program

pid_t  pid=fork()
it has 3 situation for the return result pid
0  child
>0 parent process
<0 fork fail
fork create a new process  and it parent live alse when the child process had been created ......

Can C beat RTL?


http://www.edn.com/article/457428-Can_C_beat_RTL_.php 
With the appearance of higher speeds and more DSP macrocells in low-cost FPGAs, more and more design teams are seeing the configurable chips not as glue but as a way to accelerate the inner loops of numerical algorithms, either in conjun ......

ÒÀÈ»CÄÚ´æ

Ò». ÔÚcÖзÖΪÕ⼸¸ö´æ´¢Çø
1.Õ» - ÓɱàÒëÆ÷×Ô¶¯·ÖÅäÊÍ·Å
2.¶Ñ - Ò»°ãÓɳÌÐòÔ±·ÖÅäÊÍ·Å£¬Èô³ÌÐòÔ±²»ÊÍ·Å£¬³ÌÐò½áÊøʱ¿ÉÄÜÓÉOS»ØÊÕ
3.È«¾ÖÇø£¨¾²Ì¬Çø£©£¬È«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿µÄ´æ´¢ÊÇ·ÅÔÚÒ»¿éµÄ£¬³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍ¾²Ì¬±äÁ¿ÔÚÒ»¿éÇøÓò£¬Î´³õʼ»¯µÄÈ«¾Ö±äÁ¿ºÍδ³õʼ»¯µÄ¾²Ì¬±äÁ¿ÔÚÏàÁÚµÄÁíÒ»¿éÇøÓò¡£- ³ÌÐò½áÊøÊÍ·Å
4.ÁíÍ ......

C ÓïÑÔ malloc ºÍ freeº¯Êýdz̸

À´×Ôbccn CÓïÑÔÂÛ̳
Ê×ÏÈÉùÃ÷Ò»µã£¬±¾ÎÄΪתÌù¡£
dz̸CÖеÄmallocºÍfree
×÷Õߣºlj_860603    ÔĶÁÈ˴Σº43013    ÎÄÕÂÀ´Ô´£º±¾Õ¾Ô­´´    ·¢²¼Ê±¼ä£º2006-8-5    ÍøÓÑÆÀÂÛ(32)Ìõ
Ô­Ìû¼°ÌÖÂÛ£ºhttp://bbs.bccn.net/thread-82212-1-1.html
    ÔÚCÓïÑÔµÄѧϰÖУ¬¶ÔÄÚ ......

ÈçºÎÔÚLinuxʹÓÃEclipse + CDT¿ª·¢C/C++³ÌÐò?

A. ΪʲôҪÔÚLinuxʹÓÃEclipse¿ª·¢C/C++³ÌÐò?
LinuxÊÇÒ»¸öÒÔC/C++¿ª·¢ÎªÖ÷µÄƽ̨£¬ÎÞÂÛÊÇKernel»òÊÇApplication£¬Ö÷Òª¶¼Ê¹ÓÃC/C++¿ª·¢¡£´«Í³ÔÚLinuxÏ¿ª·¢³ÌÐò£¬ÊÇÔÚÎÄ×ÖģʽÏ£¬ÀûÓÃviµÈÎÄ×ֱ༭Æ÷׫дC/C++³ÌÐò´æÅ̺ó£¬ÔÚCommand lineÏÂʹÓÃgcc±àÒ룬ÈôÒªdebug£¬ÔòʹÓÃgdb¡£
ÕâÖÖ¿ª·¢·½Ê½Éú²úÁ¦²¢²»¸ß£¬ÈôÖ»ÊÇ¿ª·¢Ñ§ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ