码迷,mamicode.com
首页 > 其他好文 > 详细

读书共享 Primer Plus C-part 8

时间:2017-07-05 17:15:21      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:span   字符   函数   strcpy   字符串函数   rcp   bsp   char s   blog   

  第十一章 字符串和字符串函数

  •    关于strcpy和strncpy

             简单说含n的相对于不含会检测数据段的大小使得数据段可控。--也可以简单的认为带n的相比较不带的更加安全可靠

  •   snprintf()

           与printf功能相差不大,最大的区别在于printf是将字符串打印到屏幕

           

char str[100];
char name[]="liuchuanwu";
int i = 100;
snprintf(str,"%d , -- %s--."i,name);

  

 

读书共享 Primer Plus C-part 8

标签:span   字符   函数   strcpy   字符串函数   rcp   bsp   char s   blog   

原文地址:http://www.cnblogs.com/liuchuanwu/p/7122349.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!