In the following I get a compiler error regarding the scope of x in the int GetInfo(); am I not using the array properly?
Code:
#include <windows.h>
#include <iostream>
#include <istream>
#include <ostream>
#include <string>
#include <vector>
#include "ShortColours.h"
using namespace std;
int GetInfo();
int Change();
int WriteInfo();
vector<string> employee;
vector<int> payrate;
vector<int> hoursworked;
vector<int> totalpay;
vector<int> fiftypounds;
vector<int> twentypounds;
vector<int> tenpounds;
vector<int> fivepounds;
vector<int> twopounds;
vector<int> onepound;
vector<int> fiftypence;
vector<int> twentypence;
vector<int> tenpence;
vector<int> fivepence;
vector<int> twopence;
vector<int> onepenny;
string name;
int rate;
int hours;
int main()
{
HANDLE hOut;
hOut=GetStdHandle(STD_OUTPUT_HANDLE);
int GetInfo();
int Change();
int WriteInfo();
return 0;
}
// Get employees, pay rates and hours
int GetInfo()
{
for (int x(0); x<6; x++)
cout<<"Employees name : ";
cin>>name;
employee.at(x)=name;
cout<<"Payrate: ";
cin>>rate;
payrate.at(x)=rate;
cout<<"Hours worked : ";
cin>>hours;
hoursworked.at(x)=hours;
totalpay.at(x)=rate * hours;
}
//Work out change required
int Change()
{
cout<<"Work out change"<<'\n';
}
//OutputInfo
int WriteInfo()
{
cout<<"Write results"<<'\n';
}