You have a simple struct, say:
typedef struct rect
{
int x;
int y;
int width;
int height;
}
rect;
And you want to multiply
If you can re-arrange your struct to take be a union instead, you can do something similar to what Microsoft has done with DirectX.
union Rect
{
struct
{
int x;
int y;
int width;
int height;
};
int members[4];
};
void multiply(Rect& rect, int factor)
{
for(int i = 0; i < 4; i++)
{
rect.members[i] *= factor;
}
}