Question: Write a C + + program that store Employee information creating an Employee array dynamically and reading the required information from the given Employee.txt file.
Write a C program that store Employee information creating an Employee array dynamically and reading the required information from the given Employee.txt file. Your code must satisfy the following requirements:
requirements
Employee struct: This struct must has the following attributes:
name string
id int
position string
dynamicallocation : Define a dynamicallocation function that receives the file path and the number of employees to be read. This function will store the read information in the dynamic memory array allocated. This function must return an Employee pointer.
updateemployeename : Define an updateemployeename function that receives four arguments. An Employee pointer, id given by the user, the
updateemployeename : Define an updateemployeename function that receives four arguments. An Employee pointer, id given by the user, the number of employees, and the new name. This function will look for the employee by it id and update the name by the given name.
Note: Check the unit test to find potential hints.
Output
Employee Carlos Professor
Employee Frederic Director
Employee Nathalie AssocDirector
Employee Katerin Instructor
Employee Camile Secretary
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
