I have an array:
unsigned char data[dataLength];
and a function:
unsigned char* get_data(int length)
I want to assign the return value of the function to the variable.
When I do it straight forward
data = get_data(length);
the compiler is complaining:
incompatible types in assignment of ‘unsigned char*’ to ‘unsigned char [(((sizetype)(((ssizetype)frameLength) + -1)) + 1)]’
It works with memcpy:
memcpy(data, get_data(dataLength), dataLength);
but I don't want to copy the data again.
Can someone help?