***What I'm trying to do:***

I'm working in a code which is not mine and I'm trying to refactor this. There I have a struct type object, let's call it **MY\_STRUCTURE** with some parameters inside. In the old version of that code, they are using memset to initialize the structure with 0 in all parameters. So, I've tried to change that memset to a more c++ standard approach which is fill or fill\_n. 

Also, I should mention... There is not an array, is just an object, so all that I'm trying to do is to initialize that object with 0 everywhere.

The memset approach which is working perfectly fine looks like 

```
this:memset(&MyScruct, 0, sizeof(MyScruct));

```

***What have I tried:***

I'm trying to use one of fill and fill\_n like this:

```
std::fill(&MyScruct, &MyScruct+ sizeof(MyScruct), 0);

```

and also 

```
std::fill_n(&MyScruct, sizeof(MyScruct), 0);

```

where MyScruct is `MY_STRUCT MyScruct`;

In both of this cases I'm getting the same error:

> 
> error C2679: binary '=' : no operator found which takes a right-hand
>  operand of type 'const int' (or there is no acceptable conversion)
> 
> 
> 

Do you have any idea why or what's happening here?