/in/foo.cc: In constructor 'Package::Package(Person, Person, double, double)':
/in/foo.cc:36:9: warning: 'Package::recip' will be initialized after [-Wreorder]
Person recip;
^~~~~
/in/foo.cc:33:9: warning: 'double Package::weight' [-Wreorder]
double weight;
^~~~~~
/in/foo.cc:83:1: warning: when initialized here [-Wreorder]
Package::Package(Person a,Person b,double w, double p)
^~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:149:11: error: invalid use of non-static member function 'void Package::print()'
ptr[i]->print;
/in/foo.cc:27:7: note: declared here
void print()
^~~~~
/in/foo.cc:150:36: error: invalid use of non-static member function 'double Package::calculateCost()'
cout << fixed << setprecision(3) << ptr[i]->calculateCost<<endl;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/in/foo.cc:70:8: note: declared here
double Package::calculateCost()
^~~~~~~
/in/foo.cc:154:16: error: invalid use of member function 'double Package::calculateCost()' (did you forget the '()' ?)
sum = ptr[0]->calculateCost + ptr[1]->calculateCost;
/in/foo.cc:154:40: error: invalid use of member function 'double Package::calculateCost()' (did you forget the '()' ?)
sum = ptr[0]->calculateCost + ptr[1]->calculateCost;