How do you want to calculate the wage? What is the point of emplresult? What does your Project 3.dat file look like? I think you're trying to do this in a very roundabout manner, there's probably an easier way of doing this other than getline, if every line has the same amount of words/numbers on it.
Your immediate error is that line 20 calls for an array of strings, and an int, but line 64 is only providing a reference to Record. You need to make these definitions match.
You have void calculate_wage (Record& payroll) // i know this isn't right .
To do this properly and pass the array by reference it would be this: void calculate_wage (Record& (payroll)[5]). In this case you have to include the size of the array. And something that would be better is: void calculate_wage (Record& (payroll)[MAXSIZE]). Where "MAXSIZE" is defined above main as constexprint MAXSIZE{5};. Now any time you need to change the size of the array or any place else in the program all you have to change is the value of "MAXSIZE" in one place.
In the "calculate_wage" function you kind of have the right idea, but you are going about it in the wrong way. You are using n array of structs, but you are not accessing each element of the struct as you should. A for loop would work for this. Also instead of the character array I would use a "std::string", which in the end is not necessary as you should be using the numeric variables from the struct.
A sample of your input file would be handy so I could test the program. And the read function is not written correctly to read a file and fill the struct.
I would suggest correcting the read function first and fix it to red the file and fill each struct in the array.
As a note you do not really have to pass the array by reference for the program to work. Most times when I am working on a program I will pass an array by reference just so I can see what it is doing in the function as I am testing. It comes in handy.
I will see what I can work up to test the program and get a better idea of what needs to be done.
Yes, the for loop is correct, but I was wrong about passing by reference. It should be (Record (&payroll)[5]). I had the & in the wrong place. Sorry it has been a little while since I have done this.
Also it would be a good idea to initialize your variables in the struct and else where when you define them. It causes less hassle of having unwanted garbage in the variables when you start. A "std::string" do not need initialized because it is empty when defined.
For the input file if there is leading white space before the name that can be dealt with. If you can change the file I would put a comma after the name and delete any white space between the comma and the ID number. The rest is OK. Of course I am basing on using "std::getline()" to read the name and the name maybe having a space in it.
The normal procedure for this task is to use a vector of employees. If you aren't allowed to use a vector then an array of employees would make your life easier.