I'm trying to swap an array of structs, and I thought following a similar fashion of storing in a temp would work like this:
int temp ,a, b;
temp = a;
a = b;
b = temp;
My array of struct definition is this:
struct storage data[10];
My attempt to swap an array of structs, I tried this:
struct storage temp[1];
temp = data[1];
data[1] = data[2];
data[2] = temp;
Unfortunately, it doesn't compile
My errors are below:
error #2168: Operands of '=' have incompatible types 'struct storage[1]' and 'struct storage'.
error #2088: Lvalue required.
error #2168: Operands of '=' have incompatible types 'struct storage' and 'struct storage*'.