Hi,
Code:
#include<stdio.h>
struct an
{
int num;
char name[256];
}a;
char *match = "This is a test: 10 ok";
int main(void) {
sscanf(match, "This is a test: %d %s", &a.num, &a.name);
printf("%d\n%s\n", a.num, a.name);
return 0;
}
When I compile the above program I am getting the below warning.
Code:
t1.c: In function ‘main’:
t1.c:13: warning: format ‘%s’ expects type ‘char *’, but argument 4 has type ‘char (*)[256]’
why I am getting this warning, I tried removing the size of char name but printf throwing similar warning, what is causing this warning and how to clear this warning?
Thanks in advance,
Alagunambi Welkin