#include<stdio.h>
int main()
{
int w,p;
char *name[1000];
for(w=0; p!=2; w++)
{
printf("Add a name: ");
gets(name[w]);
printf("Want to add another one?\n1 for yes\n2 for no\n");
scanf("%d",&p);
}
}
This code is not working. If I write: char *name[3]={"Mitchell Johnson", "Mitchell Starc", "Steven Smith"}; then it works. but i want to take strings as input. dont want to define it. But console box stops working after taking 1 string input. How to do it right? Please help. Thanks.