FOUND THE ERROR. SEEMS TO BE WORKING.
Array is a one dimensional array.
I want to copy 100 points that follow array[40] into another_array.
Can I do it without restructuring array?
memcpy(another_array, ??, 100*sizeof(float));
I tried memcpy(another_array, &array[40], 100*sizeof(float));
Actual code.
Array is a one dimensional array.
I want to copy 100 points that follow array[40] into another_array.
Can I do it without restructuring array?
memcpy(another_array, ??, 100*sizeof(float));
I tried memcpy(another_array, &array[40], 100*sizeof(float));
Actual code.
Code:
float **sprow;
sprow = (float **) calloc(FOCPLWIDTH , sizeof(float*));
for (i = 0; i < FOCPLWIDTH; i++);
sprow[i] = (float*) calloc(FOCPLWIDTH, sizeof(float));
for(fpy = 0; fpy < FOCPLWIDTH; fpy++)
{
memcpy(sprow[fpy], &dbuf[lensy*FOCPLWIDTH], FOCPLWIDTH*sizeof(float));
}
Last edited: