the console is showing the following when I am trying to run it. can someone tell me how to fix it: arrow.c:3:23: warning: 'struct student' declared inside parameter list will not be visible outside of this definition or declaration
void printInfo(struct student s1);
^~~~~~~
arrow.c: In function 'main':
arrow.c:13:15: error: type of formal parameter 1 is incomplete
printInfo(s1);
^~
arrow.c: At top level:
arrow.c:18:6: error: conflicting types for 'printInfo'
void printInfo(struct student s1){
^~~~~~~~~
arrow.c:3:6: note: previous declaration of 'printInfo' was here
void printInfo(struct student s1);
void printInfo(struct student s1);
struct student {
int roll;
float cgpa;
char name[100];
};
int main(){
struct student s1 = {1664, 9.2, "shradha"};
printInfo(s1);
return 0;
}
void printInfo(struct student s1){
printf("student information ; \n");
printf("student.roll = %d\n", s1.roll);
printf("student.name = %s\n", s1.name);
printf("student.cgpa = %f \n ", s1.cgpa);
s1.roll = 4558;
}