19行显示error: assignment to employee* from incompatiple pointer type int*
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct Employee{
char Name[100];
char Position[100];
int Salary;
};typedef struct Employee employee;
void setEmployee(char n[], char p[] , int sal, employee *e);
void showInfo(employee e);
int main()
{
int numOfEmployee;
scanf("%d",&numOfEmployee);
employee *e;
e = (int*) malloc ( numOfEmployee * sizeof(int)); //显示error:assignment to employee* from incompatiple pointer type int*
char n[100], p[100];
int sal;
for (int i = 0 ; i < numOfEmployee ; i++)
{
scanf("%s%s%d",n,p,&sal);
setEmployee( n,p,sal,&e[i]);
}
for (int i = 0 ; i <numOfEmployee ; i++)
{
showInfo(e[i]);
}
free(e);
}
void setEmployee(char n[], char p[] , int sal, employee *e)
{
strcpy(e->Name , p);
e->Salary=sal;
}
void showInfo(employee e){
printf("Name: %s\n", e.Name);
}