Quote:
|
What you need to do is to change the code in red to match the text in red. At the moment you are creating a new EnergySource, but then not doing anything with the resulting pointer.
|
EnergySource* m_sources[m_nsource] = new EnergySource(r,c);
m_nsource++
Quote:
|
The private array is m_sources - you already said that in your post above. The size of the m_sources private array in your original code was MAXROBOTS, which is not the same as MAXSOURCES.
|
So would I need to add
EnergySource* m_sources[MAXSOURCES];
as a private array?