So I'm trying to figure out how to pass a txt file to a function to be written to only. I will not need to read from it. I cannot figure out how to set up the paramters as I keep getting all kind of complicated complier errors and do not know how to decode them. Its a class project for a payroll input and the output needs to all be sent to a .txt file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
void printReportHeadings(whatgoeshere? * fileName); //prototype
int main ()
report.open ("report.txt"); //creates and opens output file called Report.txt
printReportHeadings(again what goes in here?); // function call
report.close(); //closes Report.txt file
void printReportHeadings(ostream &report) // <---are the paramters correct for the function definition?
report << "\n Employee Pay Reg Hours Gross Fed Tax SSI Tax Net";
report << "\n Name Rate Ovt Hours Pay State Tax Defr Pay";
report << "\n ========= ===== ========= ======= ======== ======= ======";
See my notes after the function proto, call, and definition.
(hopefully the formatting holds using the code tags...first time poster)
I've tried to search for an answer to my problem and haven't been able to come up with a solution yet. Thank you for any help!