搜索
查看: 2214|回复: 3

往一个字符串里加一段新的字符串的方法~内详

[复制链接]
发表于 2009-4-22 00:28:54 | 显示全部楼层 |阅读模式 来自 北京朝阳
比如说一个数组str[]中的内容是"abc",如果像把"efg"也加入进去,怎么处理?

除了用format,还有什么其他办法?
发表于 2009-4-22 23:54:07 | 显示全部楼层 来自 上海浦东新区
只要有一种方法不就行了!!
回复

使用道具 举报

发表于 2009-4-24 10:17:42 | 显示全部楼层 来自 福建漳州
strcat ( dest[], const source[], maxlength )

Maxlength is the total buffer of the destination.
(Maxlength是目标总长度)
回复

使用道具 举报

发表于 2009-4-24 23:08:26 | 显示全部楼层 来自 广东惠州
  1. /* Adds one string to another. Last parameter different from 0, specifies
  2. * how many chars we want to add. Function returns number of all merged chars. */
  3. native add(dest[],len,const src[],max=0);
复制代码
add()函数也可以的,或者用COPY()也行.
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表