In my code's output I find that the strings I am printing are all (null)
even though I input count
strings of characters < 31.
char name[31];
char *names[32];
int count = 5;
for (int i =0; i<count;i++) {
scanf("%s",name);
names[i]=(char*)malloc(strlen(name)+1);
strcpy(names[i],name);
}
for (int i =0; i<count;i++) {
printf("%d: %s\n",i+1,names[count]);
}