I need to copy elements from uint8_t array to float array.
I wrote simple function that came to my mind instantly.
float *uint8_t_mas_to_float_mas(uint8_t *src, int size)
{
float *dst = NULL;
if (!src)
return NULL;
dst = (float*)calloc(size, sizeof(float));
if (!dst)
return NULL;
for (int i = 0; i < size; i++)
dst[i] = (float)src[i];
return dst;
}
But I think it's not effective and unfortunatelly I cant come up with something else.
Can someone help?
Thank you.