7.24.2.2 “memmove
函数”:
The
memmove
function copiesn
characters from the object pointed to bys2
into the object pointed to bys1
. Copying takes place as if then
characters from the object pointed to bys2
are first copied into a temporary array ofn
characters that does not overlap the objects pointed to bys1
ands2
, and then then
characters from the temporary array are copied into the object pointed to bys1
因此,如果我选择使用 (file_size = 32K) 移动大小为 32K 的缓冲区
memmove(io_Buffer, io_Buffer+17, file_size);
临时缓冲区的大小不是 32K 吗?
问题
程序可以自己分配动态内存吗?它会在那一行中分配和释放内存吗?
最佳答案
我想你错过了那句话中的“好像”。这意味着效果将与它那样做一样,而不是它实际上会那样做。我从未见过实际使用临时数组的 memmove
实现。
关于c - memmove 是否为其临时数组使用动态内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55370165/