ASDV-Cpp/Assignments/lab4-Structures_CalebFontenot/structures.h
2024-03-25 20:54:15 -05:00

58 lines
1.2 KiB
C++

//
// Created by caleb on 3/25/24.
//
#ifndef STRUCTURES_H
#define STRUCTURES_H
#include <string>
struct Employee
{
Employee( char * pName, double salary);
Employee( char * pName, char * pAddress, char nameOfSpouse[50], double salary);
~Employee();
char * pName;
char * pAddress;
char nameOfSpouse[50];
double salary;
std::string toString();
};
/** Populates a dynamic 2D array of employees by reading the data from the console.
*
* @param pp existing 2D array to be populated.
* @param rows number of rows
* @param col number of columns
*/
void populate(Employee **pp, int rows, int col );
/** Prints the 2D dynamic array.
*
* @param pp the dynamic array
* @param rows number of rows
* @param col number of columns
*/
void print(Employee **pp, int rows, int col );
/** Frees all memory occupied by the array.
*
* @param pp the dynamic array
* @param rows number of rows
* @param col number of columns
*/
void free(Employee **pp, int rows, int col );
/**Sorts the dynamic array in ascending order by name.
*
* @param pp the dynamic array
* @param rows number of rows
* @param col number of columns
*/
void sort(Employee **pp, int rows, int col );
#endif /* STRUCTURES_H */