This question is so specific that I was having a lot of trouble finding an answer for it...
is there a way to pass a parent class' constructor parameter automatically to the constructor for a child class/struct within itself?
I want to read lines from a data file to populate my class and its children at creation, so I want to pass the data file into the child as well
my data structure is like this:
vector of class Par(ifstream parameter) membervar membervar vector of struct Chld(the same ifstream parameter) membervar vector membervar
and I'd like to be able to construct and fill all children and members by just calling the creation of the parent and giving it the datafile to read info from
vector<Par> parents(num, Par(datafile));
this would be my ideal creation line, quick and easy, and I can close the datafile right after because I have all of the info I need
is this even possible? wouldn't the default constructor just be called in the child? I was hoping not to have to go back in afterward to fill in the empty members of everything, but if I have to, I guess it can't be helped