Home > Back-end >  Some bosses know how to change this error, thank
Some bosses know how to change this error, thank

Time:11-08

#include
Typedef struct {
Char name [20].
Int score [3].
} student;
Const int number=10;
Student * student_input (student * pstudent) {
The scanf (" % s ", & amp; Pstudent - & gt; Name);
int i=0;
For (I=0; i<3; I++) {
The scanf (" % d ", & amp; Pstudent - & gt; Score [I]);
}
Return pstudent;
}
Void student_print (const student * pstudent) {
Double avg=student_averge (pstudent);
Printf (" % d ", pstudent - & gt; Name);
int i;
for(i=0; i<3; I++) {
Printf (" % d ", pstudent - & gt; Score);
}
Printf (" % 5 f ", avg);
}
Void student_average (const student * pstudent) {//average student educational function, need to pass in a address
Double sum=0.0;
int i;
for(i=0; i<3; I++) {
The sum +=pstudent - & gt; Score [I];
}
}
Int main () {
Printf (" please enter the student's name and the subject result \ n ");
Student student [number].
Student * pstudent;
Pstudent=& amp; Student [0].
int i;
for(i=0; i<10; I++) {
Pstudent=student_input (& amp; Student [I]);
Pstudent++;
}
Printf (" No \ tname \ tscore1 \ tscore2 \ tscore3 \ t ");
Pstudent=& amp; Student [0].
for(i=0; iStudent_printf (pstudent);
Pstudent++;
}
return 0;
}
An error
C: \ Users \ yhxc \ Desktop \ \ C language program statistics class students grades. C In the function 'main' :
34 11 C: \ Users \ yhxc \ Desktop \ \ C language program statistics class students grades. C [Error] 'pstudent undeclared (first use in this function)
34 11 C: \ Users \ yhxc \ Desktop \ \ C language program statistics class students grades. [Note] C each undeclared identifier is reported only once for each function it appears in the
  • Related