#include <stdio.h>
#define MAX 3 // students in class
#define LEN 20 // max lengths stydent's name
typedef struct {
char name[LEN];
int am;
float tv;
}student;
void read (student board[]) { //this function should fill the board of structs
int i;
for (i=0; i<MAX; i++) {
printf("\n give student's name");
scanf ("%s",&board[i].name);
}
}
void read (student board[]);
int main (void) {
student class[MAX];
read (class);
return 0;
}
when i try to compile it i get this error
let2.c:15:3: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘char ()[20]’ [-Wformat=]
let2.c:15:3: warning: format ‘%s’ expects argument of type ‘char ’, but argument 2 has type ‘char ()[20]’ [-Wformat=]