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

¹ØÓÚCµÄ˼¿¼


¹ØÓÚCµÄ˼¿¼
Cong Wang
May, 2006
Network Engineering Department
Institute of Post and Telecommunications, Xi'an, P.R.China
ÒýÑÔ
    CÓïÑÔ½áºÏÁË»ã±àµÄËùÓÐÍþÁ¦£¬ËüµÄ³éÏó³Ì¶ÈÅöÇɼÈÂú×ãÁ˳ÌÐòÔ±µÄÒªÇó, ÓÖÈÝÒ×ʵÏÖ¡£ÒòÆä¶ÀÌØµÄÁé»îÐÔºÍÇ¿´óµÄ¿ÉÒÆÖ²ÐÔ£¬ÏµÍ³³ÌÐòÔ±ºÍºÚ¿ÍÃǸüÊǶÔËüÖÓ°®Óмӡ£ÎÞÒÉ£¬CÓïÑÔ»ñµÃÁË¿ÕǰµÄ³É¹¦£¬ÔÚijÖ̶ֳÈÉÏÉõÖÁ±ÈUNIX»¹Òª³É¹¦¡£È»¶ø£¬“CÓïÑÔ¾ÍÏñÒ»°Ñ¿Ìµ¶£¬¼òµ¥£¬·æÀû£¬²¢ÇÒÔÚ¼¼Ê¦ÊÖÖзdz£ÓÐÓ᣺ÍÈκηæÀûµÄ¹¤¾ßÒ»Ñù£¬C»áÉ˵½ÄÇЩ²»ÄܼÝÔ¦ËüµÄÈË¡£” [8]CÓïÑÔÁé»îÐԵı³ºó£¬ÓÐןܶàµÄҪעÒâºÍ±ÜÃâµÄµØ·½£¬Ò»²»Ð¡ÐÄÄã¾Í»áÏÝÈëbugµÄÄà̶¡£ËùÒÔÒ²ÎÞ¹ÖºõÖ»ÓÐCÓïÑÔ²ÅÓÐÏñ¡¶The C Puzzle Book¡·£¬¡¶Obfuscated C and Other Mysteries¡·£¬¡¶C Traps and Pitfalls¡·Ö®ÀàµÄÊé¡£ÏÂÃæµÄÎÄÕ²»ÊǶÔÄÇЩÊéÖÐÌáµ½µÄÎÊÌâµÄÖØ¸´£¬¶øÊÇ¶ÔÆäËüһЩϸСµÄµØ·½ºÍ²¿·ÖC¿âº¯Êý½øÐÐÌÖÂÛ¡£ ´ó²¿·Ö¶¼»á¼¯Öе½±ê×¼CÉÏ£¬²Î¿¼µÄ±ê×¼ÊÇISO C99£¬Ò»Ð¡²¿·Ö¿ÉÄÜ»áÉæ¼°µ½¾ßÌåÆ½Ì¨¡£
Ò». sizeofÓëreturn
    sizeof²»ÊǺ¯Êý£¬¶øÊÇÒ»Ôª²Ù×÷·û£¬Ã»±ØÒª¸øËüºóÃæµÄ±í´ïʽ¼ÓÀ¨ºÅ¡£µ«Èç¹û¼ÆËãµÄÊÇÒ»ÖÖÀàÐ͵ĴóС£¬sizeof¾ÍÐèÒª¼ÓÒ»¸öÔ²À¨ºÅ£¬µ«Õâ²»ÊÇ˵ËüÊÇÒ»¸öº¯Êý¡£ return²»ÊǺ¯Êý£¬¶øÖ»Êǹؼü×Ö£¬Ò²²»ÐèÒªÔ²À¨ºÅ¡£»¹ÒªÌرð×¢ÒâµÄÊÇsizeof²Ù×÷·û“·µ»Ø”µÄÊÇÎÞ·ûºÅÕûÊý£¨size_t£©£¬Èç¹û°ÑËüµÄ“·µ»ØÖµ”ºÍÒ»¸öintÀàÐͱȽϣ¬ÏÈÒª°ÑËüת»¯³ÉÓзûºÅÕûÊý¡£ÁíÍ⣬Unixϵͳµ÷ÓÃread/writeµÄ·µ»ØÀàÐÍÊÇssize_t£¬¶ø²»ÊÇsize_t¡£ ssize_t´ú±ísigned size¡£
¶þ. 0.0,¡¡0,¡¡'\0' vs NULL£¬NUL
    NULL±íʾµÄÊÇ¿ÕÖ¸Õ룬ËüºÍÈκηǿÕÖ¸ÕëÖµ¶¼²»ÏàµÈ¡£¶øNUL¾ÍÊÇ'\0'£¬±íʾµÄÊÇֵΪ0µÄ¿Õ×Ö·û¡£ËäÈ»0.0, 0, '\0', NULL¶¼ÊÇÍêÈ«ÓÉ0±ÈÌØ×é³É,µ«ÊÇËüÃǵij¤¶È²»Í¬¡£0.0ÊÇË«¾«¶È£¬Í¨³£ÊÇ8¸ö×Ö½Ú£»'\0'ÊÇ×Ö·û³£Á¿£¬Í¨³£Ö»ÓÐ1¸ö×Ö½Ú£»NULL±íʾ¿ÕÖ¸Õ룬ËüµÄ³¤¶ÈÓÉϵͳ¾ö¶¨£¬Ò²¾ÍÊÇϵͳÖд¢´æÒ»¸öÄÚ´æµØÖ·ËùÐèµÄ×Ö½ÚÊý£»0±íʾÕûÊý,Ò»°ãÊÇ4¸ö×Ö½Ú¡£ËüÃǵÄÀàÐͲ»Í¬£¬ÔÚÓÃËüÃǸø±äÁ¿¸³ÖµÊ±Ó¦¸ÃСÐÄ£¬ÓбØÒªÊ±½øÐÐÇ¿ÖÆ×ª»»¡£×¢Ò⣺CÓïÑÔ²»±£Ö¤char×ÜÊÇ8¸ö±ÈÌØ£¬Ò²ÓÐ7¸ö»ò9¸ö±ÈÌØµÄ×Ö·û£¡ËäȻûÓй涨shortÊÇ16¸ö±ÈÌØ£¬intÊÇ32¸ö±ÈÌØ£¬µ«ÊÇÔÚĿǰµÄËùÓй¹¼ÜÉ϶¼ÊÇÈç´Ë¡£ long²¢²»×ܺÍintÒ»Ö£¬ËüÓë»úÆ÷×Ö³¤Ò»Ö£¬Ò²¾ÍÊÇ˵ÔÚ32λ»úÉÏËüÊÇ4¸ö×Ö½Ú£¬¶øÔÚ64λ»úÉÏÊÇ8¸ö×Ö½Ú¡£ l


Ïà¹ØÎĵµ£º

ÓÃCдµÄ3DÃÔ¹¬

          Boss˵£¬Òª¿´OpenGL£¬¿´ÁË¿ìÒ»¸öÔ£¬×ÜËã³öÁ˸öÏñÑùµÄ¶«Î÷£¬ÓÃCдÁ˸ö3DÃÔ¹¬£¬
ËäȻֻÓÐ350ÐÐ
       ´úÂ룬²»¹ý±ßѧ±ßд£¬×ã×ãдÁËÒ»ÖÜʱ¼ä£¬»¹ÊÇСÓгɾ͸е쬻î»î»î£¡
         &n ......

c/c++ Êý×Öת³É×Ö·û´®, ×Ö·û´®×ª³ÉÊý×Ö

Êý×Öת×Ö·û´®£º
ÓÃC++µÄstreanstream:
#include <sstream>
#Include <string>
string num2str(double i)
...{
        stringstream ss;
        ss<<i;
        return ss.str();
......

¶¨ÒåC/C++È«¾Ö±äÁ¿/³£Á¿¼¸ÖÖ·½·¨µÄÇø±ð£¨×ª£©


 
ÔÚÌÖÂÛÈ«¾Ö±äÁ¿Ö®Ç°ÎÒÃÇÏÈÒªÃ÷°×¼¸¸ö»ù±¾µÄ¸ÅÄ
1. ±àÒëµ¥Ôª(Ä£¿é)£º
    ÔÚIDE¿ª·¢¹¤¾ß´óÐÐÆäµÀµÄ½ñÌ죬¶ÔÓÚ±àÒëµÄһЩ¸ÅÄîºÜ¶àÈËÒѾ­²»ÔÙÇå³þÁË£¬ºÜ¶à³ÌÐòÔ±×îŵľÍÊÇ´¦ÀíÁ¬½Ó´íÎó(LINK ERROR), ÒòΪËü²»Ïñ±àÒë´íÎóÄÇÑù¿ÉÒÔ¸ø³öÄã³ÌÐò´íÎóµÄ¾ßÌåλÖã¬Äã³£³£¶ÔÕâÖÖ´íÎó¸Ðµ½°ÃÄÕ£¬µ«ÊÇÈç¹ûÄ ......

zz C/C++ÖеÄÈÕÆÚºÍʱ¼ä


C/C++ÖеÄÈÕÆÚºÍʱ¼ä
ͻ񻣼
±¾ÎÄ´Ó½éÉÜ»ù´¡¸ÅÄîÈëÊÖ£¬Ì½ÌÖÁËÔÚC/C++ÖжÔÈÕÆÚºÍʱ¼ä²Ù×÷ËùÓõ½µÄÊý¾Ý½á¹¹ºÍº¯Êý£¬²¢¶Ô¼ÆÊ±¡¢Ê±¼äµÄ»ñÈ¡¡¢Ê±¼äµÄ¼ÆËãºÍÏÔʾ¸ñʽµÈ·½Ãæ½øÐÐÁ˲ûÊö¡£±¾ÎÄ»¹Í¨¹ý´óÁ¿µÄʵÀýÏòÄãչʾÁËtime.hÍ·ÎļþÖÐÉùÃ÷µÄ¸÷ÖÖº¯ÊýºÍÊý¾Ý½á¹¹µÄÏêϸʹÓ÷½·¨¡£
¹Ø¼ü×Ö£ºUTC£¨ÊÀ½ç±ê׼ʱ¼ä£©£¬Calendar Time£¨ ......

anic£º±ÈC¿ì±ÈJava°²È«±Èshell»¹¼òµ¥µÄÐÂÓïÑÔ

һλIDΪultimusµÄ³ÌÐòÔ±¿ª·¢ÁËÒ»ÖÖÃûΪanicµÄÐÂÓïÑÔ£¬½üÈÕÒýÆðÒµ½ç¹Ø×¢¡£¸ù¾ÝGoogle CodeÉϸÃÏîÄ¿µÄ¼ò½é£¬¸ÃÓïÑÔµÄÕýʽÃû³ÆÊÇANI£¬anicÊÇÕâÖÖÓïÑԵIJο¼ÊµÏÖ¡£
ANIÊÇÒ»ÖÖʵÑéÐÔ¡¢¸ßÐÔÄÜ¡¢¾²Ì¬°²È«¡¢ÍêÈ«Òþº¬Ö§³Ö²¢ÐС¢ÃæÏò¶ÔÏóµÄͨÓÃÊý¾ÝÁ÷±à³ÌÓïÑÔ¡£
anicÓÃGNU¹¤¾ßÁ´Ð´³É£¬Òò´Ë¿ÉÒÆÖ²ÐԺܺ㬿ÉÒÔÔËÐÐÓÚËùÓÐÖ÷Á÷²Ù×÷ϵ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ