I'm in the process of working on a program using void functions to get the gross pay. When I call the functions in main the program isn't running
#include <iostream>
#include <iomanip>
using namespace std;
/* **************************************************
// This program calculates the gross wages *
// for seven employees using their employee *
// ID *
************************************************** */
int employees;
const int num = 7;
void time(long [], int [], int num);
void pay(long [], double [], int []);
void wage(long [], double[], double [], int [], int);
int main()
{
long empID [num]= {5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 7580489};
Your code doesn't compile. When that happens, the compiler tells you what the problems are. You need to read those error messages and then fix your code.
The first error messages will be something about how the line of code time(empID[employees],hours[employees], num );
is a problem because hours doesn't exist.
Also, it appears you don't understand how to create arrays or how to use them.
empID[employees] is a single int value, and because employees was never set it's some random value, so this will probably crash even if you did get it running. You need to go back and learn about arrays.
Are you saying that employees need to be set to zero when I declared it as a global variable. In the original message program isn't running = program is not compiling
how is empID[employees] a single int value if it's set up as an element loop calling each element from empID[0] to empID[7]
empID[0] is the first value in that array. An int.
empID[1] is the second value in that array. An int.
empID[2] is the third value in that array. An int.
...
empID[employees] is a value in that array. An int.
So this function cal: time(empID[employees],hours[employees], num );
is passing three parameters. The first one is an int (not an array - one int from the array), the second is a value from the non-existent array named hours (this is bad - you can't use arrays that don't exist), and the third is an int.
Are you saying that employees need to be set to zero
I'm saying you need to set it to something. What number should it be? Should it be zero? Should it be seventeen? Should it be minus ten? Work out what value it should be, and set it. It probably is zero by default; it's been so many years since I engaged in the bad practice of global variables that I've no idea anymore what they do.