Hello, friends. I'm pretty much a beginner here. I unfortunately had a very poor intro to c++ teacher that taught us only to pass the exam, not really stuff to implement during routine practice. I am now in Advanced c++ and I'm struggling pretty badly. I've been able to write the program completing all requirements except for one... creating a function that accepts a nested structure array. Here's the program:
I honestly don't know why I'd need a function either. However, the assignment requirements say:
Write a function to calculate the grossPay member variable. Your function needs to accept a struct PayRoll variable. You may either pass it by reference OR pass the struct by value and RETURN the changed struct.
I hope that clarifies this a little better. Thanks for your response!
void calculateGrossPay(PayRoll& employee)
{
//calculate and set employee GrossPay
//Any changes you make for this employee
//will be reflected on original passed structure.
}
You need to forward declare function or make a prototype if you intend to use function befor it has been defined or if you want your function to be in another cpp file (in that case function prototype is usually placed into header)
Function prototype will look like void calculateGrossPay(PayRoll& employee);