You should declare the structure before the main.
struct Rect {
double x;
double y;
char color;
double width;
double height;
}
/* Place here the function definitions */
int main (int argc, char *argv[]) {
struct Rect a, b, *rec;
...
}
/* place here the function code */
Since you're declaring it inside the main() it's not seen outside, so functions don't recognise it.
Other than that, the way you're calling the function (function(&a, &b)
) looks correct.