could I get a bit more help
Hello, I keep getting this error
Run-Time Check Failure #2 – Stack around the variable ‘wage’ was corrupted
anyone able to point me in the right direction please?
Code:
#include <iostream>
#include <iomanip>
#include <C:\Documents and Settings\Pat\Desktop\school\prog14.cpp\prog14.cpp\empinfo.h.cpp>
using namespace std;
int main()
{
const int MAX = 25;
struct info employee[MAX];
int count = 1;
char (ret);
for (int i=0; i<=count; i++)
{
cout << "input Last Name:"<< endl;
cin.getline (employee[i].last1,25);
cout << "Input First Name:" << endl;
cin.getline (employee[i].first1,25);
cout << "Input payrate:" << endl;
cin >> employee[i].payrate;
cout << "Input Hours Worked:" << endl;
cin >> employee[i].hours;
cin.get (ret);
}
double wage[1];
for (int j=0; j<=count; j++)
{
if (employee[j].hours <=40)
wage[j] = employee[j].payrate *40;
else wage[j] =employee[j].payrate*40 +(employee[j].hours - 40) * employee[j].payrate * (3/2);
cout << employee[j].last1 << setw(10) << employee[j].first1 << endl;
cout << employee[j].payrate << endl;
cout << employee[j].hours << endl;
}
return 0;
}