I am attempting to copy a return value from a method into an array of ints. (The method getPixelArray returns an int array of size 3.) Below is the offending section of my code. When I try to compile this code, I get the error
invalid lvalue in unary '&'
What could be going on? I was following the advice from this answer.
int temp[3];
memcpy(&temp, &(getPixelColor(width, height, x, y)), sizeof(temp));
EDIT: Here is the method.
int[3] getPixelColor(int width, int height, float x, float y) {
int color[3] = {0, 0, 0}; // color of pixel
// get color (omitted)
return color;
}