View Single Post
Old Nov 30th, 2006, 12:51 AM   #10
aznballerlee
Hobbyist Programmer
 
Join Date: Nov 2006
Posts: 111
Rep Power: 2 aznballerlee is on a distinguished road
Quote:
Yes, but again looking at your code - what part of this function uses the array? And what part in all your code would cause m_nsources to change?
Initially, m_nsources is 0. When we created the new EnergySource, a pointer is created to m_sources[m_nsource]. Once the source has been recorded in the array, we increment m_nsources. Repeatedly, when addEnergySource is called again and again, the m_nsources is incremented, until it exceeds the MAXSOURCES.
Quote:
Yes! You already have a private array, so I would suggest this is the time to use it.
This is my problem.
aznballerlee is offline   Reply With Quote