Question: In C, in an Unix environment (Plan9), I have got an array as memory. 

```
uchar mem[32*1024];

```

I need that array to contain different fields, such as an int (integer) to indicate the size of memory free and avaliable. So, I've tried this:

```
uchar* memp=mem;
*memp=(int)250; //An example of size I want to assign.

```

I know the size of an int is 4, so I have to force with casting or something like that, that the content of the four first slots of mem have the number 250 in this case, it's big endian.

But the problem is when I try to do what I've explained it doesn't work. I suppose there is a mistake with the conversion of types. I hopefully ask you, how could I force that mem[0] to mem[3] would have the size indicated, representated as an int and no as an uchar?

Thanks in advance

Answer: 
Like this:

```
*((int*) memp) = 250;

```

That says "Even though `memp` is a pointer to characters, I want you treat it as a pointer to integers, and put this integer where it points."
Cast pointer to `int`, not `unsigned char` again!

```
int * memp = (int *)mem;
* memp = 250; //An example of size I want to assign.

```