I am making a program where the user enters 15 names names and determines if it is male or female, the problem I have is that the program ends abruptly after the input, I tried to use char*
but the compiler returnserror: invalid conversion from 'const char*' to 'char' [-fpermissive]
#include <stdio.h>
#include <string.h>
int main( ) {
char n[15],h[15],d[15], g[15];
int i,c=0,p=0,e;
printf("\nCuantos nombre desea ingresar?\n");
scanf("%d",&e);
for(i=0;i<e;i++){
printf("ingrese el nombre %d\n",i+1);
scanf("%s",&n[i]);
printf("escoja el genero de %s\n",n[i]);
scanf("%s",&g[i]);
if(g[i]=='m'){
n[i]=h[i];
c=c+1;
}
else if(g[i]=='f'){
n[i]=d[i];
p=p+1;
}
}
printf("-----------------\n");
printf("%d hombres: \n",c);
for(i=0;i<c;i++){
printf("%s\n",h[i]);
}
printf("%d mujeres: \n",p);
for(i=0;i<p;i++){
printf("%s\n",d[i]);
}
}