#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
void display(int e_no, char e_name[30], char e_dep[10], float e_sal);
struct employee
{
int em_id;
char name[30];
char department[10];
float salary;
};
static struct employee em1={420, "Ramesh", "Computers", 9500.0};
display (em1.em_id, em1.name, em1.department, em1.salary);
getch();
return 0;
}
void display(int e_no, char e_name[30], char e_dep[10], float e_sal)
{
cout<<"The initialized information is :";
cout<<endl<<"Employee's id number :"<<e_no;
cout<<endl<<"Employee's name :"<<e_name;
cout<<endl<<"Employee's department :"<<e_dep;
cout<<endl<<"Employee's salary :"<<e_sal;
}
|
|

| To display the contents of a structure passing the individual elements to a function. |
|
| |
|
|
|
|