while((a[i].sex != '0') && (a[i].sex != '1'))
{
printf("Error, please may you enter 1 for male or 0 for female(person %d)\n", i);
scanf("%d",&a[i].sex);
}
why does this not work if someone enters in 1 / 0 for a[i].sex
while((a[i].sex != '0') && (a[i].sex != '1'))
{
printf("Error, please may you enter 1 for male or 0 for female(person %d)\n", i);
scanf("%d",&a[i].sex);
}
why does this not work if someone enters in 1 / 0 for a[i].sex
sorry ignore I am a dumb git made a typo
while((a[i].sex != '0') && (a[i].sex != '1'))
That won't work because you're using the characters 0 and 1, which are completely different in integer value from the integers 0 and 1.
while( ( a[i].sex != 0 ) && ( a[i].sex != 1) ) {
-Prelude