c++ call superclass constructor with calculated arguments
问题 probably it's super easy, but can someone tell me how I can call the superclass' constructor with arguments calculated in the subclass' constructor? something like this: class A{ A(int i, int j); }; class B : A{ B(int i); }; B::B(int i){ int complex_calculation_a= i*5; int complex_calculation_b= i+complex_calculation_a; A(complex_calculation_a, complex_calculation_b); } //edit: i edited the example so that the superclass takes two arguments which have a relation to each other 回答1: If you