Hi there ... I need help with the following program.It is giving me error. Thanks very much.
/*Write a structure function to enter Roll number, Name, Department, Course, Year of joining and print them out */
#include <stdio.h>
struct student
{
char name;
char dep;
char course;
int roll;
int year;
};
main( )
{
struct student d1[5];
name(d1) ;
}
name(struct student d2[5])
{
int i;
printf("Enter Roll Number,Name, Department, Course, Year of Joining\n");
for(i=0;i<=2;i++){
fflush(stdin);
scanf("%d %s %s %s %d",&d2[i].roll,&d2[i].name,&d2[i].dep,&d2[i].course,&d2[i].year);
}
for(i=0;i<=2;i++)
printf("\nRoll Number:%d Name:%s Department:%s Course:%s Year of Joining:%d",d2[i].roll,d2[i].name,d2[i].dep,d2[i].course,d2[i].year);
}