View Single Post
Old Nov 29th, 2006, 9:43 PM   #4
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 825
Rep Power: 4 The Dark is on a distinguished road
if (MAXSOURCES)
    return false;
else
//    ?  = new Energysource();
MAXSOURCES is a constant, you need to be checking the number of sources you have already added (you should know how to do this, as you already added the member variable)
If you haven't already added the maximum number of sources, you then need to create one a keep track of where it is. Again you should know where to put the new source as you have already added the member variable (from the hint, i'm guessing).

Note that the private array you have added for sources has the wrong size.
The Dark is online now   Reply With Quote