Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将内容从一个字符缓冲区获取到另一个字符缓冲区?例如我有
char buffer[SMALLVALUE]; char new_buffer[BIGGERVALUE];
我想将内容复制buffer到new_buffer. 做到这一点的最短方法是什么?
buffer
new_buffer
#include <string.h> memcpy(new_buffer, buffer, sizeof buffer);