Hi guys
I'm trying to run so called student-administration program.
I got functions that can read and write student data, but the one saving the data from about 30 students has some problem that I can't figure. (warning: I'm quite new to C programming)
so this is the code:..I guess I can't use global variables as function arguments?
Code:
//global variables
static char ReturnName[31];
static char ReturnFirstName[31];
static float ReturnAverage;
typedef struct{
char Name[31];
char FirstName[31];
float Average;
}Student;
//defines the linked list for 30 Students
Student Students[30];
//program to save all 30s
void SaveData(ReturnName,ReturnFirstName, ReturnAverage){
int i;
for(i=1;i<=30;i++){
//check if the students is already registered
if(!((Students.Name)&&(Students.FirstName))){
Students[i].Name=ReturnName;
Students[i].FirstName=ReturnFirstName;
}
}
}
the errors:
Code:
incompatible types when assigning to type 'char[31]' from type 'int'