Soumyadip Rakshit wrote:
I have a 2D Array of Integers A[3][5]. I would like to copy it to another
array B[3][5] taking each row at a time. They are both initialized as
pointers to pointers.
I would like to use something like the following but it doesn't seem to
work
for (i=0; i < 3; i++) {
while(*A[i]++ = *B[i]++)
;
}
After the loop is complete, wouldn't A and B point to the _end_ of the
array, not the beginning? So do make sure to backup the original pointers
before beginning the loop. Also, are you one-hundred per cent sure the
array is zero-terminated? (like for c-strings)
For all I know, the code you posted should theoretically work. Perhaps a
more complete example would be nice?