memccpy() -- string字符串的拷贝
来源:互联网 发布:淘宝商盟图片 编辑:程序博客网 时间:2024/05/29 13:21
相关函数: bcopy(), memcpy(), memmove(), strcpy(), strncpy()
表头文件: #include <string.h>
定义函数: void *memccpy(void *dest, const void *src, int c, size_t n);
函数说明: memccpy()用来拷贝src所指的内存内容前n个字节到dest所指的地址上。与memcpy()不同的是,memccpy()如果在src中遇到某个特定值(int c)立即停止复制。
返回值: 返回指向dest中值为c的下一个字节指针。返回值为0表示在src所指内存前n个字节中没有值为c的字节。
void * memccpy (void *restrict to, const void *restrict from, int c, size t [Function]
size)
This function copies no more than size bytes from from to to, stopping if a byte
matching c is found. The return value is a pointer into to one byte past where c was
copied, or a null pointer if no byte matching c appeared in the first size bytes of from.
定义函数: void *memccpy(void *dest, const void *src, int c, size_t n);
函数说明: memccpy()用来拷贝src所指的内存内容前n个字节到dest所指的地址上。与memcpy()不同的是,memccpy()如果在src中遇到某个特定值(int c)立即停止复制。
返回值: 返回指向dest中值为c的下一个字节指针。返回值为0表示在src所指内存前n个字节中没有值为c的字节。
void * memccpy (void *restrict to, const void *restrict from, int c, size t [Function]
size)
This function copies no more than size bytes from from to to, stopping if a byte
matching c is found. The return value is a pointer into to one byte past where c was
copied, or a null pointer if no byte matching c appeared in the first size bytes of from.
#include <string.h>
#include <stdio.h>
int main()
{
char a[] = "string[a]";
char b[] = "string(b)";
memccpy(a, b, 'b', sizeof(b)); //a[] = "string(b]"
printf("memccpy():%s\n", a);
}
- memccpy() -- string字符串的拷贝
- memccpy() -- 拷贝内存内容
- 字符串函数memccpy
- 利用string 字符串拷贝
- 利用string 字符串拷贝
- memccpy
- memccpy
- memccpy
- String的浅拷贝
- String的深拷贝
- String类的浅拷贝,深拷贝
- 字符串拷贝的问题
- 字符串拷贝的错误
- UniCode字符串的拷贝
- 字符串的拷贝
- 字符串拷贝的一系列问题
- 字符串的拷贝
- 字符串的拷贝
- RHEL6 KVM安装备忘
- 关于VC编译错误fatal error C1083的解决办法
- 基于linux视频架构V4L2分析-----video for linux(一)
- ArrayList与Vector之间的区别
- 事故总结报告
- memccpy() -- string字符串的拷贝
- 敏捷开发学习笔记——实践XP尽可能满足的先决条件和推荐
- 函数调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。
- 大数乘法
- 一步一步学习IOS的密码
- symantec NBU status 96
- ByteBuffer用法小结
- related with 有序数组中第K小的数
- 水产干贝