-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmystruct.h
More file actions
executable file
·45 lines (40 loc) · 1.35 KB
/
mystruct.h
File metadata and controls
executable file
·45 lines (40 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/** mystruct.h
* This file is main skeleton file to hold the main function.
* The production and testing suite will be called from here.
*
* Date: February 15, 2019
* Student: Tom Graham
* Author: Mike Ciaraldi
*/
// Struct definition:
// Maximum number of characters in an employee name
#define MAX_NAME (99)
#include <stdlib.h>
/**
* The struct for the employee. My pseudo object.
*/
struct Employee {
int birth_year; // Year the employee was born
int start_year; // When the employee started with the company.
char name[MAX_NAME + 1];
};
// Function prototype(s):
struct Employee* makeEmployee(int birth, int start, const char* name);
struct Employee* generateEmployee();
int generateNumbers(int birth); //helper
char generateChar(); //helper
const char* generateName(size_t n);
void printEmployee(struct Employee *e);
struct Employee** generateWorkforce(size_t count);
void printStructs(struct Employee **ptrArray, size_t count);
/**
* @param temp is the pointer of employee pointers.
*/
struct Employee** shallowCopyArray(struct Employee **temp, size_t count);
struct Employee** deepCopyArray(struct Employee **temp, size_t count);
/**
* @param temp is the pointer of employee pointers again
* @param count the count of workers to free
*/
void freeWorkers(struct Employee **temp, size_t count);
struct Employee* duplicateStructs(struct Employee* temp);