Okay, I've tried writing something, but now I have lots and lots of wonderful errors.
In here, it says on the line with void addNewEntry() that:
using namespace std;
int validateMenuInput(int length);
float getSalary(int hours, float pay);
void addNewEntry(std::vector<database>& employee); //Errors are here
"'database' was not declared in this scope"
"template 1 argument is invalid"
"template 2 argument is invalid"
"ISO C++ forbids declaration of 'employee' with no type"
Looks like it doesn't realize I declare database as a structure later.. How do I make sure the function declaration knows what database is?
I tried to sort out the errors that'll go away when addNewEntry() works properly.. That left me with some on the line that declares the vector:
std::vector<database> employee; //Errors are here
"'main()::database' uses local type 'main()::database'"
"trying to instantiate `template<class _Alloc> class std::allocator'"
"template argument 2 is invalid"
"invalid type in declaration before ';' token"
I just included this in case it's important. generateIdNumber() just returns a number between 10001 and 98304, and getSalary() calculates monthly salary with overtime wages for more than 40 hours a week. I doubt they're causing the problem.
void addNewEntry(std::vector<database>& employee)
employee.back().idNumber = generateIdNumber();
cout<<"ID Number: "<<employee.back().idNumber;
cout<<"Enter the employee's name: ";
cout<<"Enter the employee's age: ";
cout<<"Enter the employee's title: ";
cout<<"Enter the employee's wage: ";
cout<<"Enter the employee's weekly hours: ";
employee.back().salary = getSalary(employee.back().hours, employee.back().wage);
cout<<"Employee's salary: "<<employee.back().salary;
Like most errors I'm guessing this is all because of one thing, which I guess is that the program doesn't realize the vector is for database, especially in the declaration for addNewEntry()