View Single Post
Old Nov 30th, 2006, 3:09 PM   #14
aznballerlee
Hobbyist Programmer
 
Join Date: Nov 2006
Posts: 111
Rep Power: 2 aznballerlee is on a distinguished road
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?
aznballerlee is offline   Reply With Quote