Question: #include stdio.h #include stdlib.h #include struct.h #include string.h #include populateRecords.h #include patient.h #include employee.h #define NUM_RECORDS 20 int main() { struct person *person

#include "stdio.h"
#include "stdlib.h"
#include "struct.h"
#include "string.h"
#include "populateRecords.h"
#include "patient.h"
#include "employee.h"
#define NUM_RECORDS 20
int main()
{
struct person *person = NULL;
int numRecords = 0; // number of records to be created
char rc = 0;
// add code to get the number of records to be created
// if number of records is not given then insruct the user what is required.
// populating the array person with data of patients and employees
populateRecords(person, numRecords);
// add code here
//
return 0;
}
Allocating memory for the person array The program needs to allocate memory to create as many persons as determined by the user when invoking the program. Once the memory was allocated, the program can populate the array by invoking the function populateRecords() in file populateRecords.c (file populateRecords.h contains that function prototype). Note that you will have to link the file with your code. Remember to release the memory before the program terminates.
Step by Step Solution
3.48 Rating (155 Votes )
There are 3 Steps involved in it
To allocate memory for the person array based on the number of records determined by the user we sho... View full answer
Get step-by-step solutions from verified subject matter experts
