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.