Q:

set member of array to zero

Morning, 
I hope somebody is here
suppose I have the following structure or even better an array of structures
struct foo {
  int a;
  char b[10];
  char c;
};

struct foo* bar;
bar = (struct foo*) malloc(sizeof(struct foo)*10);
memset(bar, -1, sizeof(struct foo)*10);

instead of 
for (counter = 0; counter < 10; ++counter)
      memset(bar[counter],0,sizeof(char)*10);

how to a set b member to 0 in all array of char / b member in all array?
basically my question is a bit similar to this one 

A:

You can set the b member of each array element to zero by setting the b member of each array element to zero. You were almost there, but:

You only wanted to zero the b member.
The thing you're zeroing isn't 8 bytes long.

 
for (counter = 0; counter < 10; ++counter)
    memset(bar[counter].b, 0, sizeof bar[counter].b);

