These function calls are not compiling for some reason, I receive the following error message when I attempt to compile.

hw11.cpp: In function âint main()â:
hw11.cpp:70: error: expected primary-expression before â]â token
hw11.cpp:71: error: expected primary-expression before â]â token
hw11.cpp:71: error: expected primary-expression before â]â token
hw11.cpp:72: error: expected primary-expression before â]â token
hw11.cpp:73: error: expected primary-expression before â]â token
hw11.cpp:73: error: expected primary-expression before â]â token

Lines 70 through 73 are represented in the Call code lines 1 through 4 below.

Any insight will be greatly appreciated.

Prototypes

void output(string[],int[],int,ofstream&);
void classcalc(int[],int,ofstream&);
void highscore(string[],int[],int,ofstream&);
void nameconv(string[],int,ofstream&);

Calls

nameconv(name[],stcount,outfile);
  output(name[],score[],stcount,outfile);
  classcalc(score[],stcount,outfile);
  highscore(name[],score[],stcount,outfile);

Headings

void nameconv(string name[], int stcount, ofstream& outfile)
// Funtion will convert names in array into proper formatting, uppercase first
// letter, rest lowercase.

void output(string name[],int score[], int stcount, ofstream& outfile)
// Function will print name of student(s) with their corresponding score in
// prescribed formatting.

void classcalc(int score[], int stcount, ofstream& outfile)
// Function will calculate average scores and standard deviation.  Will then
// print stcount, average, and standard deviation.

void highscore(string name[], int score[], int stcount, ofstream& outfile)
// Function will read through an array of numbers and determine which
// one(s) are the highest.  It will then print this score along with
// corresponding name(s).

Recommended Answers

All 2 Replies

Are necessary headers #included prior to the lines in question?
The functions calls shouldn't have the [] part.
Do your headings have the curly-brace part?

Your code may be long, but you've edited out important details. It's generally best not to paraphrase code.

Ah I see what I did, no need for brackets in the function call. Thank you for the assistance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.