C program for employee details using pointers
#include<stdio.h> #include<conio.h> struct employee { char emp_name[30]; int emp_id; float salary; }; int main() { struct employee emp; struct employee *ptr; ptr= &emp; printf("\nEnter Name of employee: "); scanf("%s",ptr->&emp_name); printf("\nEnter id of employee: "); scanf("%d",ptr->&emp_id); printf("\nEnter salary of employee: "); scanf("%f",ptr->&salary); printf("\nEntered details of employee are: \n"); printf("\nEmployee Name : %s \n\nEmployee id: %d \n\nSalary: %.02f \n\n", ptr->emp_name,ptr->emp_id,ptr->salary); return 0; }