All pastes #218659 Raw Edit

Untitled

public text v1 · immutable
#218659 ·published 2006-10-24 08:50 UTC
rendered paste body
#include <iostream>

using namespace std;

struct A {
        A() {
                print();
        }
        virtual void print() {
                cout <<"A"<<endl;
        }
};

struct B:A {
        void print() {
                cout<<"B"<<endl;
        }
};

int main(int argc, char** argv) {
        B foo = B();
        return 0;
}