viewing paste Unknown #15917 | C++

Posted on the
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
 
#include <iostream>
#include <string>
 
using namespace std;
 
 
int checkID(int empID[]);
void saveInfo(int userID, int empID[]);
void displayInfo();
 
int main()
{
int userID = 0; // Which array slot
int empID[7] = {1,2,3,4,5,6,7};
//{5658845,4520125,7895122,8777541,8451277,1302850,7580489};
int hours[7] = {0};
double payrate[7] = {0};
double wages[7] = {0};
 
cout << "Please enter your userID: ";
userID = checkID(empID);
 
cout << userID;
//saveInfo(userID, empID);
 
cin.get();
return 0;
}
 
int checkID(int empID[])
{
//Checks which ID
int ID = cin.get();
 
    for(int i=0;i < 7;i++)
    {
        if(empID[i] == ID)
        {
            cout <<"This works";
            return 312;
        }
    }
    return 117;
}
Viewed 836 times, submitted by Guest.