#include<stdio.h>
#include<string.h>
#define MAX 50
struct student
{
int srn;
char stu_name[30];
char course[18];
char addr[50];
};
int main()
{
struct student st[MAX];
int i;
for (i = 0; i < MAX; i++)
{
printf("\nEnter name of the student %d : ", st[i].srn=i+1);
scanf("%s", st[i].stu_name);
printf("\nEnter course of the student %d : ", i+1);
scanf("%s", st[i].course);
printf("\nEnter address of the student %d : ", i+1);
scanf("%s", st[i].addr);
}
for (i = 0; i < MAX; i++)
{
printf("\nname of student %d is %s", i+1, st[i].stu_name);
printf("\ncourse is %s", st[i].course);
printf("\naddr is %s", st[i].addr);
}
return 0;
}
i wrote this code for a school project but codeblocks keeps giving me this error.Anyone know the solution?
main.c|21|error: '(struct student *)&st' is a pointer; did you mean to use '->'?|