954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Error in void functions

Following are my prototype definitions:

int fillArray (double commission[], int salesID[], int employeeCode[], int numUnits[], double numDollars[]) ;
void printReport (ofstream& fout, double commission[], int salesID[], int employeeCode[], int numUnits[], double numDollars[]);
void printHeader (ofstream& fout);


The two void functions are the one's that I'm getting errors on
following are my function calls: ( which is where the errors are)

void printHeader (fout);
void printReport (fout,commission,  salesID,  employeeCode, numUnits,  numDollars, n);


commision, salesID, etc are arrays (obv) and fout is a ofstream. I can post the functions if need be but basically all printheader does is column headers, no variables or arrays or anything, and all printreport does is print all the arrays. I keep getting the following errors:

test5-2.cc:137: error: variable or field ‘printHeader’ declared void
test5-2.cc:137: error: invalid conversion from ‘void*’ to ‘int’
test5-2.cc:138: error: variable or field ‘printReport’ declared void
test5-2.cc:138: error: initializer expression list treated as compound expression

oh and the two lines the errors are in (137 and 138) are my functions calls

ellimist14
Light Poster
45 posts since Feb 2009
Reputation Points: 9
Solved Threads: 0
 

Don't put the keyword "void" in front of the function calls. Just use the function name.

printHeader (fout);
printReport (fout,commission,  salesID,  employeeCode, numUnits,  numDollars, n);
vmanes
Posting Virtuoso
1,914 posts since Aug 2007
Reputation Points: 1,268
Solved Threads: 228
 

Also, organize your data into structs (if you are able/allowed).

nucleon
Posting Pro in Training
478 posts since Oct 2008
Reputation Points: 163
Solved Threads: 91
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You