Hello C++.com,
I'm relatively new to coding (a few months), and I need some help figuring out how to fix this program I'm writing for an assignment. Most of the grunt work is actually done, and I can compile, but when I run, I get a memory dump.
To explain the purpose of the program, we are given two files; one file has a list of teams names and team IDs (sample here:
https://coderpad.io/485235 ), and another file with team IDs with either scores for a game or a bye, separated by week (sample here:
https://coderpad.io/260478 ). From these, the program is supposed to come up with a sorted week-by-week list similar to this:
Rankings after week #N
RANKING: Team_Name (W-L-T)
RANKING: Team_Name (W-L-T)
RANKING: Team_Name (W-L-T)
BLANKLINE
|
As for the actual program, the only requirements are that the program is made of three files; team.h (
https://coderpad.io/313159 ), team.cpp (
https://coderpad.io/108960 ), and main.cpp (
https://coderpad.io/485332 ). Additionally, team.h must contain a class called Team with member arrays for name, ID, wins, losses, and ties, but any additional member variables or member functions are on my perogative. I can assume that I will only be given up to fifty teams to add into the arrays.
Now, the issue I have is that somewhere within either function Team::getScores or Team::setResults, some command is causing a 'segmentation fault (core dump)' and I don't exactly know what the issue is. I have suspicion it could be my loop implementation, but I do not know where to look to use any debug cout statements. I was hoping that perhaps someone a bit more experienced could help me figure out what the issue is.
In advance, thank you for your time, and I hope I can get a response soon.
Per Laborem ad Astra,
JbstormburstADV