linux----strcat、strncat
来源:互联网 发布:时间序列数据库 编辑:程序博客网 时间:2024/06/05 17:54
165 /**
166 * strcat - Append one %NUL-terminated string to another
167 * @dest: The string to be appended to
168 * @src: The string to append to it
169 */
170 #undef strcat
171 char *strcat(char *dest, const char *src)
172 {
173 char *tmp = dest;
174
175 while (*dest)
176 dest++;
177 while ((*dest++ = *src++) != '\0')
178 ;
179 return tmp;
180 }
181 EXPORT_SYMBOL(strcat);
182 #endif
用于将src所指向的字符串拷贝到dest所指向字符串末尾。
184 #ifndef __HAVE_ARCH_STRNCAT
185 /**
186 * strncat - Append a length-limited, %NUL-terminated string to another
187 * @dest: The string to be appended to
188 * @src: The string to append to it
189 * @count: The maximum numbers of bytes to copy
190 *
191 * Note that in contrast to strncpy(), strncat() ensures the result is
192 * terminated.
193 */
194 char *strncat(char *dest, const char *src, size_t count)
195 {
196 char *tmp = dest;
197
198 if (count) {
199 while (*dest)
200 dest++;
201 while ((*dest++ = *src++) != 0) {
202 if (--count == 0) {
203 *dest = '\0';
204 break;
205 }
206 }
207 }
208 return tmp;
209 }
210 EXPORT_SYMBOL(strncat);
211 #endif
同strcat函数不同的是,如果没有到字符串结尾,它只拷贝count大小字节数据,并且在dest末尾加上字符串的结束符'/0'
- linux----strcat、strncat
- linux系统库函数之strcat、strncat
- strcat和strncat函数
- strcat函数 strncat函数
- strcat strncat的使用方法
- strcat和strncat
- strcat,strncat函数
- strcat 和strncat 函数学习
- strcat和strncat的实现
- 实现strcat( )和strncat( )函数
- 模拟实现strcat strncat函数
- 连接函数strcat与strncat
- strcat()函数和strncat()函数
- 模拟实现strcat与strncat
- strncpy strcpy strncat strcat sizeof strlen 概述
- strcpy/strcat && strncpy/strncat && strlcpy/strlcat 总结
- strcmp,stricmp,strncmp,strncmpi,strcat,strncat
- strcpy,strncpy;strcat,strncat;memcpy,memncpy;
- 关于ubuntu几个脚本的源代码
- fiddler工具使用说明
- C# 自动运行代码 (创建windows 服务的形式 )
- CALayerInvalidGeometry', reason: 'CALayer position contains NaN:
- linux
- linux----strcat、strncat
- 把一个文档集(document set)复制到另一个文档库(library)中
- oracle 数据库模式对象,索引,序列,同义词,查看用户拥有的表,聚簇,数据库链接
- 浅谈SQL注入式攻击与防范之一
- 【太美了】【Crystal Castle.水晶城堡】【严泽远作品】
- 系统调用
- ios7 uitableview group模式顶部有个空白的解决方法
- sql 查询去重
- FileUpload控件使用初步