memccpy-失败时目标缓冲区的状态

一个问题,当memccpy找不到字符时,目标缓冲区会如何处理?

该手册未对失败后dest的状态进行任何说明。它会覆盖还是保持不变?以下是从手册页复制的内容。

void *memccpy(void *dest,const void *src,int c,size_t n);

DESCRIPTION
The memccpy() function copies no more than n bytes from memory area src to memory area dest,stopping when the character c is found.

If the memory areas overlap,the results are undefined.

RETURN VALUE
The memccpy() function returns a pointer to the next character in dest after c,or NULL 
if c was not found in the first n characters of src.

xiangjibo 回答:memccpy-失败时目标缓冲区的状态

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2928532.html

大家都在问