int x[10],y[10];
x = y;
Run Code Online (Sandbox Code Playgroud)
我正在考虑一个简单的黑客,这将使我能够获得这种效果.
caf*_*caf 19
您可以将它们包装在struct
s中以使用简单的赋值:
struct foo { int a[10]; } x, y;
x = y;
Run Code Online (Sandbox Code Playgroud)
但实际上,只需使用memcpy
.
ken*_*ytm 11
您需要使用memcpy
(或memmove
)传输内存块.
memcpy(x, y, sizeof(x));
Run Code Online (Sandbox Code Playgroud)