网上查了一下,runtime包有这个功能,但是没有导出。
Golang 在 C++ 中有类似 memmove 的东西吗?
void * memmove ( void * destination, const void * source, size_t num );
我相信副本就是你要找的。
src := []byte("some data")
dst := make([]byte, len(src))
copy(dst, src)
println(string(dst)) // prints 'some data'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
578 次 |
| 最近记录: |