employee[6]->printreport();
report->printheaders();
You cannot make the above function calls because the pointers are not pointing to allocated objects. I.e. you need to do e.g.
report = new payroll();
// ... now you can utilize the 'report' pointer
report->printheaders();
Note that the indexes are zero-based i.e. if you have employee[ [B]6[/B] ]
, then the last valid index is 5 (not 6).