please can you help me? How can I copy part of one int array to another int array?
Example:
typedef struct part {
int * array;
} PART;
int array[] = {1,2,3,4,5,6,7,8,9};
PART out[] = new PART[3];
for (int i = 0; i < 3; i++)
{
memcpy((char *)array[i * 3], (char *)out[i].array, 3 * sizeof(int));
}
But this don't working... :(
memcpyis probably wrong. the first argument ofmemcpyis the destination, not the source.