custom header file can someone help?
I need to make a custom header file for a program which calls for various information about employees. such as ID, First Name, Last Name, Street Address, City, Zip Code, and Phone Number.
If i could fix the header file im pretty sure i could do the rest. But heres what I have so far...
heres the header file.
Code:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define employee
void ClearInputBuffer();
employee CollectData();
void RaiseSalary(employees * p, int N, double PercentOfArrays);
employee FindHighestPaid(employees * p, int N);
void DisplayEmployee(employee e);
typedef struct {
void ClearInputBuffer()
{
while(getchar() ! = '\n')
continue;
}
employee CollectData()
{
long ID;
char FirstName[20];
char LastName[30];
double Salary;
char StreetAddress[50];
char City[30];
char State[2];
char ZipCode[10];
char Telephone[13];
printf("Enter ID:");
fflush(stdout);
scanf("%ld", &p.ID);
ClearInputBuffer();
printf("Enter first name:");
fflush(stdout);
scanf("%s", &p.FirstName[20]);
printf("Enter last name:");
fflush(stdout);
scanf("%s", &p.LastName[30]);
printf("Enter the Street Address:");
fflush(stdout);
scanf("%s", &p.StreetAddress[50]);
ClearInputBuffer();
printf("Enter the city:");
fflush(stdout);
scanf("%s", &p.City[30]);
printf("Enter the state:");
fflush(stdout);
scanf("%s", p.State[2]);
printf("Enter the zipcode:");
fflush(stdout);
scanf("%s", &p.ZipCode[10]);
printf("Enter the telephone number:");
fflush(stdout);
scanf("%s", &p.Telephone[13]);
printf("Enter the salary:");
fflush(stdout);
scanf("%lf", &p.Salary);
return 0;
}
void RaiseSalary(employees * p, int N, double PercentOfArrays)
{
int i;
for(i = 0; i < N; i++)
{
PercentOfArrays = (&p -> Salary) * .06;
}
return 0;
}
employee FindHighestPaid(employees * p, int N)
{
employee q;
int i;
q = *p
for(i = 1; i < N; i++)
{
if(((p + i) -> Salary > q.Salary))
{
q = *(p + i);
}
}
return q;
}
void DisplayEmployee(employee e)
{
printf("----------------------------------------------\n");
printf("\t %s \t %ld \t %.2lf \t\n");
return 0;
}