Yes, it would work. However, for performance reasons, relatively big
struct
s are usually passed via pointers (see, for instance,
PtInRect
Windows function signature)
int inrect (int x, int y, const rect *pr) {
if (x<pr->left || x>pr->right || y<pr->top || y>pr->bot)
return 0;
return 1;
}