#include <stdio.h>
#include <string.h>
struct employee
{
char ename[20];
int sal;
};
struct employee accept(struct employee);
void display(struct employee);
void main()
{
struct employee e,f;
f=accept(e);
display(f);
}
struct employee accept(struct employee e)
{
printf("Enter employee name and his sal :");
gets(e.ename);
gets(e.sal);
}
void display(struct employee e)
{
printf("Employee name :");
puts(e.ename);
printf("Employee salary :");
puts(e.sal);
}
The above code is taking the details from the user and not displaying it as it is supposed to do. Can anyone help me out rectifying it?