I get a segfault with the scanf. How to I do this properly?Code:char *titles[10];
int main(void)
{
int i;
char *temp;
for(i = 0; i < 10; i++)
{
printf("Enter Team Name %d: ", i + 1);
scanf("%s", &temp);
strcpy(titles[i], temp);
}
for(i = 0; i < 10; i++)
printf("%s", titles[i]);
}