I tried memset to assign all the structure members to 0
memset(&s1, 1, sizeof(s1));
This will definitely not zero the struct members.
And this will:
memset(&s1, 0, sizeof(s1));
If you want to set them to the another value you need to answer one question : How portable do you want it to be?
The portable way:
struct sample s1 = { 1,1,1,1,1,1}; // initialisation
s1.a = 1;
s1.b = 1;
s1.b = 1;
s1.d = 1;
s1.e = 1;
s1.f = 1;
Non portable way (assuming the same type and no padding between members):
#define NMEMBERS 6
int *ptr = (void *)&s1;
for(int index = 0; index < NMEMBERS; index++, ptr++)
{
*ptr = 1;
}