Saturday, 30 August 2014

c program by using structure to functions


c program by using structure to functions


#include<stdio.h>
#include<string.h>
struct employee
{
  int id:
char name[20];
float salary;
};
void func(struct employee *record);
void main()
{
 Struct employee record;
record.id=1;
clrscr();
strcpy(record.name, ”xxxx”);
record.salary=300000;
func(&record);
getch();
}
  void func(struct employee *record)
{
  printf(“Id is:%d\n”,record->id);
  printf(“Name is:%d\n”,record->name);
  printf(“Salary is:%d\n”,record->salary);
}









No comments: