So I have a class Star which inherits another class CelestialBody . There's a third class Planet as well.
In my class Star in the private section I have an array of Planet objects Planet* system and an int n standing for the number of the planets.
Problem is - how do I construct it? I've tried this:
Star(char* newName, double newX, double newY, double newDiam, Planet* newSystem, int newN) : CelestialBody(newName, newX, newY, newDiam)
{
system = new Planet[newN];
system = newSystem;
n = newN;
}
but apparently it doesn't work...
Thanks for helping my out in advance!
systemdoes not make much sense...strcpy(name, newName)instead of the second assignment.std::vectorand forget about the pointers?