All pastes #460564 Raw Edit

Anonymous

public text v1 · immutable
#460564 ·published 2007-04-27 03:28 UTC
rendered paste body
#include <iostream>
#include <vector>
using namespace std;

class A {
        public:
                void test() { cout << "a" << endl; };
};

class B : public A {
        public:
                void test() { cout << "b" << endl; };
};

int main() {
        vector<A> abc;
        abc.resize(5);
        abc[0] = B();
        abc[0].test();
}