class A {
public:
    A(void) { cout << "A::A" << endl; }
    A(const A& a) { cout << "A::A(a)" << endl; }
    virtual ~A(void) { cout << "A::~A" << endl; }
    virtual void g(void) { cout << "A::g" << endl; }
};
class B : public A {
public:
    B(void) { cout << "B::B" << endl; }
    ~B(void) { cout << "B::~B" << endl; }
    void g(void){ cout << "B::g" << endl; }
};
void print(A c) {
    cout << "print" << endl;
}
int main(void) {
    A a;
    B b;
    A* c = &b;
    c->g();
    print(*c);
    return 0;
}
I don't understand why this statement A::A(a) get's executed when calling c->g() or print(*c);
And I'm not quite sure to which part of the programm does the Method print belongs to?
 
     
     
     
    