You have defined the function as returning a student:
struct student printstudent()
{
But you try to return an array of students:
struct student e[3];
...
return e;
You can't do that - they need to be exactly the same type.
Probably, you don't want to declare an array, just a single item, but since you don;t actually use it in the main function, you might be better changing it so that the printstudent function accepts a student to print and returns nothing (a void).
Mind you, I'd make printstudent print something instead of creating an instance myself anyway... :laugh: