You have a simple struct, say:
typedef struct rect
{
int x;
int y;
int width;
int height;
}
rect;
And you want to multiply
Like everyone has said, you can't do it directly, but there's nothing stopping you from overloading the * operator:
struct rect
{
int x;
int y;
int width;
int height;
}
rect operator*(const rect& r, int f)
{
rect ret=r;
ret.x*=f;
ret.y*=f;
ret.width*=f;
ret.height*=f;
return ret;
}
then you can do this
rect r;
//assign fields here
r=r*5;