subject

IN C language: This problem relies on the following struct definition:typedef struct Employee{char *first; // Employee's first name. char *last; // Employee's last name. int ID; // Employee ID.} Employee;Consider the following function, which takes three arrays – each of length n – containing the first names, last names, and ID numbers of n employees for some company. The function dynamically allocates an array of n Employee structs, copies the information from the array arguments into the corresponding array of structs, and returns the dynamically allocated array. Employee *makeArray(char **firstNames, char **lastNames, int *IDs, int n){int i;Employee *array = malloc();for (i = 0; i < n; i++){array[i].first = malloc( );array[i].last = malloc();strcpy(array[i].first, firstNames[i]);strcpy(array[i].last , lastNames[i]);array[i].ID = IDs[i];}return array;}a) Fill in the blanks above with the appropriate arguments for each malloc() statement. b) Next, write a function that takes a pointer to the array created by the makeArray() function, along with the number of employee records in that array (n) and frees all the dynamically allocated memory associated with that array. The function signature is as follows:void freeEmployeeArray(Employee *array, int n){

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
What does a cascading style sheet resolve a conflict over rules for an element? a. the rule affecting the most content wins b. the rule affecting the most content loses c. the rule with the most specific selector loses d. the rule with the most specific selector wins
Answers: 2
question
Computers and Technology, 22.06.2019 15:30
In a compound condition, both conditions on either side of the logical operator and must be true for the overall condition to be true. a: true b: false
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Michael has written an e-mail to his employees that describes a new product special that will be introduced to the customers next week. by taking time to make sure the e-mail is well written, logical, and organized, michael has made sure his message has the characteristics of a) effective communicationb) ineffective communicationc) barriers to communicationd) workplace communication
Answers: 2
question
Computers and Technology, 23.06.2019 10:00
Hey i just logged on and one of the moderators deleted a bunch of my answers to questions, even though the answers were right and the people it doesn't make sense but if anyone wants to talk about anything just message me lol (this is super random lol)
Answers: 1
You know the right answer?
IN C language: This problem relies on the following struct definition:typedef struct Employee{char *...
Questions
question
Mathematics, 07.07.2020 09:01
question
Mathematics, 07.07.2020 09:01
question
Mathematics, 07.07.2020 09:01
Questions on the website: 13722367