What are the C++ rules for calling the superclass constructor from a subclass one?
For example, I know in Java, you must do it as the first line of the subclass cons
The only way to pass values to a parent constructor is through an initialization list. The initilization list is implemented with a : and then a list of classes and the values to be passed to that classes constructor.
Class2::Class2(string id) : Class1(id) {
....
}
Also remember that if you have a constructor that takes no parameters on the parent class, it will be called automatically prior to the child constructor executing.