c++ - 函数参数太少 ‘memcpy’

标签 c++ c memory

我的理解是 memcpy 必须有 3 个参数:

void * memcpy ( void * destination, const void * source, size_t num );

所以我正在尝试这段代码:

//char *tmpPtr is a pointer that points to some data
char frameBuffer[921600]; //destination starting a given index
int bufferIndex;//the given index
memccpy(frameBuffer+bufferIndex,tmpPtr,Data.size()-1);

但我收到此错误:

error: too few arguments to function `void * memccpy (void *, const void *, int, size_t)

最佳答案

错别字:

memccpy
   ^^

你调用了错误的函数。

memccpy 还接受一个字符(作为 int 参数),遇到该字符应停止复制。

关于c++ - 函数参数太少 ‘memcpy’,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14224857/

相关文章:

c++ - Boost.ASIO 性能不佳

c++ - 这段 C 代码有什么作用 [Duff 的设备]?

c - If else 参数被忽略

c - glibc 检测到 realloc() : invalid next size

c++ - 将 std::array<char, 10> 的最后一个字符转换为 int

java - 查看 Thread 使用了多少 RAM

c - 内存分配 - 4 的倍数的地址

c++ - 在 qglwidget 的顶部添加按钮

c++ - 从看似相同的计算中得到不同的输出

c - 在 C 中实现类型变量