Question: Create a C program with the following capability. Define a structure named as Employee with the following items: First name may be up to 20
Create a C program with the following capability.
- Define a structure named as Employee with the following items:
- First name may be up to 20 chars. Use array of chars.
- Last name may be up to 20 chars. Use array of chars.
- Salary double variable.
- Create an array of Employee structure for storing data for up to 100 employees. Name the array as EmployeeArr1.
- Find out the size (in terms of number of bytes) of Employee structure and print it.
- Find out the size (in terms of number of bytes) of EmployeeArr1 array and print it.
- Dynamically create by using malloc() an array of Employee structure for storing data for up to 200 employees. Name the array as EmployeeArr2.
- Find out the size (in terms of number of bytes) of EmployeeArr2 array and print it.
- Find out the address of EmployeeArr1[0] you have to use a format string of %p inside printf function to print an address.
- Find out the address of EmployeeArr1[99] and print it.
- Find out the address of EmployeeArr2[0] and EmployeeArr2[99] and print them.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
