618 views
–1 votes
–1 votes
#include<stdio.h>
int main()
{
char str[20];
printf("enter string");
scanf("%s",&str);
printf("%s",str);
}

 

warning getting   "format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[20]’ [-Wformat=]
 scanf("%s",&str);"

why this warning?

1 Answer

Related questions

0 votes
0 votes
1 answer
1
2 votes
2 votes
2 answers
4
atulcse asked Jan 15, 2022
662 views
Consider the following programint find (int n) { int a = 1; for (i = 1; i < = n; i ++) for (j = 1; j < = i; j++) for (k = 1; k <= j, k++) a = a + 1; ...