I am getting a warning saying assignment from incompatible pointer type . I am new to programming and tried my best but still couldn't figure it out. I am getting the following error: 20 6 D:DS programspractical 2employees_structure_pointer.c [Warning] assignment from incompatible pointer type
/* Accept n employee details using structure and pointer and display their details. */
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
struct employee
{
int no,salary;
char name[10],desig[10];
}*ptr;
int main()
{
int i,n;
printf("Enter total number of employees: ");
scanf("%d",&n);
ptr = (int*)calloc(n,sizeof(struct employee));
printf("
Enter employee details:
");
for(i=0;i<n;i++)
{
printf("Enter employee number: ");
scanf("%d",&(ptr+i)->no);
printf("Enter name of the employee: ");
scanf("%s",(ptr+i)->name);
printf("Enter designation of the employee: ");
scanf("%s",(ptr+i)->desig);
printf("Enter salary of the employee: ");
scanf("%d",&(ptr+i)->salary);
printf("
");
}
printf("Employee details are:
");
for(i=0;i<n;i++)
{
printf("
Employee number is: %d",(ptr+i)->no);
printf("
Employee name is: %s",(ptr+i)->name);
printf("
Employee designation is: %s",(ptr+i)->desig);
printf("
Employee salary is: %d",(ptr+i)->salary);
}
return 0;
}