Question: (IN C LANGUAGE) Need to create some function definitions based on the following information... Here are the descriptions and information about the functions I need

(IN C LANGUAGE) Need to create some function definitions based on the following information...

(IN C LANGUAGE) Need to create some function definitions based on the

Here are the descriptions and information about the functions I need to create (the last 2 functions should say Function 3 and 4 not 1 and 2)

following information... Here are the descriptions and information about the functions I

need to create (the last 2 functions should say Function 3 and

And for the main the functions just need to be called using a command-line argument.

4 not 1 and 2) And for the main the functions just

**Assume the text file is simply containing info such as employee first name, last name, id and ONLY 3 DEPENDENTS!

Please be clear, thank you in advance.

#define SIZE 25 #define NUM_EMP 3 /* definition of an employee record*/ typedef struct employee { char fname [20]; char lname [20]; int id; char dependents [3] [20]; // assume that no employees can have more // than 3 registered dependents } Employees; Function 1. This function takes 2 parameters - an array of type Employees and an integer variable (e.g., c). Function name: printEmployees Prototype: void printEmployees (Employees [NUM_EMP], int c); Description: Prints information (i.e., fname, Iname, id and dependents) of c number of employees. Returns nothing. Function 2. This function takes 3 parameters - an array of type Employees, an integer variable (e.g., c) and a string that holds the name of a text file. Note that this name must be accepted from command line and then passed to this function. Function name: saveEmployees Prototype: void saveEmployees (Employees [NUM_EMP], int c, char [SIZE]); Description: Save information (i.e., fname, Iname, id and dependents) of c number of employees in a text file. Returns nothing. Function 1. This function takes 2 parameters - an array of type Employees, and a string that holds the name of a text file. Function name: loadEmployees Prototype: int loadEmployees (Employees [NUM_EMP],char[SIZE]); Description: Load all employee records that are stored in a text file to an array of Employees. Returns the total number of records loaded. Function 2. Swap information of 2 Employees. Function name: swapEmployees Prototype: void swap Employees (Employees *, Employee *); a Function main() write it in a file called lab1Main.c: This function calls the above 4 functions to test them. Use a command-line argument to input the filename and pass it to functions saveEmployees and loadEmployees

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!