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