#include<stdio.h>
struct employee
{
char name[25] ;
int id ;
int age ;
float inc ;
} b[3] ;
int main()
{
int i ;
for(i = 0 ; i < 3 ; i++)
{
printf("Enter name , id , age , inc of employee %d :- ",i+1) ;
scanf("%s%d%d%f",&b[i].name,&b[i].id,&b[i].age,&b[i].inc) ;
}
printf("\n") ;
for(i = 0 ; i < 3 ; i++)
{
printf("%s%d%d%f\n",b[i].name,b[i].id,b[i].age,b[i].inc) ;
}
return 0 ;
}
Output on compiling :
warning: format ‘%s’ expects argument of type ‘char ’, but argument has type ‘char ()[25]’ [-Wformat=] scanf("%s%d%d%f",&b[i].name,&b[i].id,&b[i].age,&b[i].inc) ;
How to fix the warning ?