I try to type simple 2D array of string take strings from user and print it
void in(char* n[3][2]);
void show_name ()
{
char* n[3][2];
in(n);
unsigned int i,j;
for(i=0;i<3;i++)
{
for(j=0;j<2;j++)
printf("%s ", &n[i][j]);
printf("\n");
}
}
int main(void)
{
show_name();
return 0;
}
void in(char* n[3][2])
{
int i,j;
for(i=0;i<3;i++)
for(j=0;j<2;j++)
scanf("%s",&n[i][j]);
printf("\n");
}
it works correctly but i have warning say:
warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char**' [-Wformat]|
I searched for reason i found that the problem in %s
doesn't need for address
when i remove &
operator there`s no warning but code doesn't run correctly