[kde-china] c 语言字符串...
Roy Qu
royqh1979在gmail.com
星期一 十二月 1 04:11:08 CET 2008
strncpyÒ²ÊÇÒªÅжÏ\0µÄ¡£ËüµÄ×÷ÓÃÊÇÏÞÖÆ¿½±´µÄ×î´ó³¤¶È£¬·ÀÖ¹»º´æÇøÒç³ö¡£Òò´Ë
ΪÁËÌá¸ß³ÌÐò°²È«ÐÔ£¬ÏÖÔÚ¶¼½¨ÒéÓÃstrncpy´úÌæstrcpy¡£
ÄãÏë˵µÄÒ²ÐíÊÇmemcpy£¬ÄǸöÊÇ°´ÕÕÖ¸¶¨³¤¶È¿½±´¡£
2008/12/1 <panshizhu在routon.com>
>
> Æäʵ C ÓïÑÔ²¢Ã»ÓÐÇ¿ÖÆÕâô×ö£¬¾ø´ó¶àÊý C ×Ö·û´®º¯Êý¶¼°üº¬°´Áã½áβ´¦ÀíºÍ°´Ö¸
> ¶¨³¤¶È´¦ÀíµÄÁ½ÖÖ°æ±¾¡£
> ÀýÈ磺
> strcpy vs strncpy
> strcmp vs. strncmp
> µÈµÈ¡£
> Òò´Ë£¬¼´Ê¹ÄãʹÓà C ÓïÑÔ£¬Ò²ÍêÈ«¿ÉÒÔʹÓÃÒ»¸ö¶ÀÁ¢µÄÕûÊý±ê¼Ç×Ö·û´®³¤¶È£¬È»ºó¶Ô
> ÓÚËùÓеÄ×Ö·û´®²Ù×÷ʹÓôø n µÄ×Ö·û´®º¯Êý¡£¨D¨DÏÔÈ»£¬Ö±½ÓÔÚ C ÓïÑÔÖÐÕâô×ö£¬±à
> ³ÌÉÏ»á±ÈʹÓÃÁã½áβÉÔ΢Â鷳һЩ£¬µ«Èç¹ûÄãʹÓÃÊʵ±µÄ°ü×°¿ÉÒÔ¹æ±ÜÕâЩÎÊÌâ¡£²»
> ÒªÍüÁËpascal ʹÓõ¥×Ö½Ú±ê¼Çµ¼ÖÂ×Ö·û´®×î´ó³¤¶È 255 µÄÏÞÖÆ£¬ËüÖ»ÔËÓÃÓÚ½Ì
> ѧ£¬¶øÕâÖÖÏÞÖƶÔÒ»¸öʵÓõÄÓïÑÔÀ´ËµÏÔÈ»ÊDz»¿É½ÓÊܵġ£
>
> ÊÂʵÉÏÎÒ²»ÖªµÀÄãÕæµÄʹÓÃÈκΠprofiler ¹¤¾ß²âÁ¿¹ýûÓУ¬Êµ¼Ê¶ÔÓÚ C ÓïÑÔ×Ö·û
> ´®£¬¶àÊýÆÕͨÇé¿öÏÂÁ½ÕßµÄЧÂʲî¾à²¢²»´ó£¬¶Ôʵ¼ÊÔËÐÐЧÂʵIJâÁ¿ºÜ¶àʱºò»áÈÃÈË
> »³ÒÉ×Ô¼ºËùѧµÄ֪ʶ¡£¨D¨DÒ²ÐíÒòΪijЩÀíÂÛ¼Ò´ÓÀ´²»×ö²âÁ¿¡£
>
> µ±È»xmlÊǸö°ÑÕâÖÖ²î¾àÔËÓõ½¼«ÖµÄÀý×Ó£¬²»¹ýËÓÖÄܹæ±ÜÕâ¸öÎÊÌâÄØ£¿¶ÔÓÚÈκνÅ
> ±¾ÓïÑԵĽâÎö¶¼²»¿ÉÄܱÜÃâ×Ö·û´®ËÑË÷ÒÔ»ñÈ¡½áÊø·ûµÄÎÊÌ⣬Õâ²¢²»¶ÀÊÇxmlµÄ£¬ÎÄ·¨
> ½âÎöЧÂÊÓ¦µ±ÊÇËùÓнâÊÍÐͽű¾´æÔÚµÄÎÊÌâ¡£
> --
> Sincerely, Pan, Shi Zhu.
>
> yarco <yarco.w在gmail.com> дÓÚ 2008-11-28 20:49:50:
> > ¶÷¶÷......²»¹ýÎÒ˵µÄµÄÈ·ÊÇÖ´ÐÐЧÂÊ......
> >
> > ÎÒÂò¹ýÒ»±¾½Ð"Joey˵Èí¼þ"Êé. ÄÇÀ↑ƪÌáµ½µÄÄǸöÎÄÕºܾµä, ´ÓcÓïÑÔ×Ö·û
> > ´®Ò»Ö±Ì¸µ½ÎªÊ²Ã´xmlÖ´ÐÐЧÂʲ»¸ß.
> > ºÃÏñÔÒòÊÇÒòΪcÓïÑÔ×Ö·û´®ÊǸù¾Ý\0À´¼ÆËã½áÊø·ûµÄ. ÕâÑùÔںܶà¹ý³ÌÖÐÒªÅÐ
> > ¶ÏÒ»¸ö×Ö·û´®¾ÍÒª´ÓÍ·µ½Î²±éÀúµ½\0.
> > ¶ødelphi(ºÃÏñÊÇdelphi)×Ö·û´®ÊÇ°ÑÄǸö\0 1byteÈóöÀ´, ÓÃÀ´´æ·Å³¤¶È(Ëù
> > ÒÔdelphi×Ö·û´®³¤¶ÈÖ»Äܵ½256.
> > ÔÙ³¤¾ÍµÃÓÃStringBuilder)...xmlÓÐÏàËƵÄÇé¿ö,
> > ÒòΪֻÓнáÊø±ê¼Ç<tag></tag>´Ó³ÌÐò½Ç¶È¾ÍÎÞ·¨¿ìËÙ´¦Àí(¼ÙÈçÊǸölength,
> > ¾ÍÄÜÂíÉÏÆ«Òƶ¨Î»)...
> >
> > ²»¹ýÆæ¹ÖÀíÓÉÕâô³ä·Ö...µ½Ä¿Ç°ÎªÖ¹ËƺõҲû¿´¹ýʲô±ä»¯...
> > (¾ÝÄDZ¾Êé˵, excel¿ª·¢µÄʱºò²»Ê¹ÓÃc string, ¶øÄÚ²¿ÊµÏÖÁËÒ»¸ö×Ö·û´®µÄ
> > ½á¹¹, ÕâÑùÖ´Ðзdz£¸ßЧ....)
> >
> >
> _______________________________________________
> kde-china mailing list
> kde-china在kde.org
> https://mail.kde.org/mailman/listinfo/kde-china
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://mail.kde.org/pipermail/kde-china/attachments/20081201/536d4a85/attachment.htm
关于邮件列表 kde-china 的更多信息