Hello, there.
I'm trying to write a program which reads student information from keyboard and does some calculations. I've just started it and I dont know much about this "Struct" topic. As far as I know, I've tried to do something and here is the result.
#include <stdio.h>
#define N 2
#define ISIMUZUN 15
struct student{
char name[ISIMUZUN];
char surname[ISIMUZUN];
char number[10];
int final;
int midterm;
int hw1;
int hw2;
};
int main(int argc, char *argv[])
{
struct student i;
for(i=0; i<N; i++)
{ printf("Please enter student number %d information with blanks between them\n", i+1);
scanf( "%s %s %s %d %d %d %d", i.number, i.name, i.surname, i.midterm, i.final, i.hw1, i.hw2 );
printf("%s %s %s %d %d %d %d\n", i.number, i.name[ISIMUZUN], i.surname[ISIMUZUN], i.midterm, i.final, i.hw1, i.hw2 );
}
system("pause");
return 0;
}
I'm getting several errors while compiling this. Does anyone have an idea about whats wrong with it?
Regards..