I created a boolean 2D array and used `memset` like this :

```
bool chk[3][3];

memset(chk, 1, 9*sizeof(chk[0]));

```

I got output as expected using the following blocks of code (got 1 in every row )

```
for(int i = 0 ; i < 3; i++){
    for(int j = 0; j < 3; j++)
        cout<<chk[i][j] <<" ";
    cout<<endl;
}

```

but when I tried to manipulate the array I got unexpected result 

and then I tried with

```
memset(chk, 1, 9*sizeof(chk[0][0]));

```

and this time everything was fine and got my expected result(after manipulation)

Can you please help me pointing out what exactly happened in memset() ?