Can someone help please this is due in 6 hours lol, i tried a new show function since maybe that was the problem, now i'm getting these 4 errors.
Lines 9-14 .
Help is very appreciated
||=== Build: Debug in Program3 (compiler: GNU GCC Compiler) ===|
C:\STAC CP2- brennan\prog3\Program3\main.cpp||In function 'void showGoalies(Goalie*, int)':|
C:\STAC CP2- brennan\prog3\Program3\main.cpp|129|error: invalid use of member 'std::__cxx11::string Goalie::getName() const' (did you forget the '&' ?)|
C:\STAC CP2- brennan\prog3\Program3\main.cpp|129|error: expected ')' before 'c_str'|
C:\STAC CP2- brennan\prog3\Program3\main.cpp|131|error: invalid use of member 'void Goalie::setName(const string&)' (did you forget the '&' ?)|
C:\STAC CP2- brennan\prog3\Program3\main.cpp|132|error: invalid use of member 'void Goalie::setTeam(const string&)' (did you forget the '&' ?)|
||=== Build failed: 4 error(s), 2 warning(s) (0 minute(s), 0 second(s)) ===|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
void showGoalies(Goalie *g_ptr, int count)
{
/* Display the headings for each column, with spacing and justification flags */
printf("%s%15s%25s%8s\n", "Name", "Team", "Wins", "Losses");
// Read goalie data from file using ',' as a delimiter.
for (int i = 0; i < count; i++) {
if (g_ptr->setName.c_str() != 0) {
printf("%-8d%-30s%-10d%-2.2f\n",
g_ptr->setName.c_str(),
g_ptr->setTeam.c_str(),
g_ptr->setWins,
g_ptr->setLosses);
g_ptr++;
}
/* If the name field is zero, then we reached the last player, break
* out of the for loop.
*/
else
break;
}
}
|