I got this question/assignment on a test yesterday at university. It goes like this:

```
Give the following structure:

typedef struct _rect {
     int width;
     int height;
} rect;

How could you scale the width and height members using a cast to int* without explicitly accessing the two members?

```

So basically, given that struct, how could I do

```
rect *my_rectangle = malloc(sizeof(rect));
my_rectangle->width = 4;
my_rectangle->height = 6;

// Change this part
my_rectangle->width /= 2;
my_rectangle->height /= 2;

```

Using a cast to int or int\*?