S
stelladiary2004
Hi!
I would appreciate some help with this (basic) question. I need to
copy an 2D array x to another 2D array y. I know how to do it copying
element by element, but I would like to use a faster method (because I
have to do many many copies). Can anyone tell me a faster method (one
who thak's less time running)? Thanks.
I'm using the following method:
----------------------------------------
int
x[3][3] = {{0,1,2},{3,4,5},{6,7,8}},
y[3][3],
i, j;
int main()
{
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
y[j] = x[j];
return 0;
}
----------------------------------------
I would appreciate some help with this (basic) question. I need to
copy an 2D array x to another 2D array y. I know how to do it copying
element by element, but I would like to use a faster method (because I
have to do many many copies). Can anyone tell me a faster method (one
who thak's less time running)? Thanks.
I'm using the following method:
----------------------------------------
int
x[3][3] = {{0,1,2},{3,4,5},{6,7,8}},
y[3][3],
i, j;
int main()
{
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++)
y[j] = x[j];
return 0;
}
----------------------------------------