All pastes #904950 Raw Edit

Etwas

public cpp v1 · immutable
·published 2008-02-15 12:38 UTC
rendered paste body
//main.h#if !defined(MAIN_H)#define MAIN_Hnamespace test {class BASE {   public:      BASE() { }      BASE(int val) { this->m_val = val; }      virtual ~BASE() { }      virtual int func(int val);      int m_val;};class DERIVED : public BASE {   public:      DERIVED() : BASE() {}      DERIVED(int val) : BASE(val) {}      virtual ~DERIVED() {}      int func(int val);};}#endif //MAIN_H//main.cpp#include "main.h"namespace test {int BASE::func(int val) {   return 0;}int DERIVED::func(int val) {   this->m_val = val;}int main(){   int tmp;   BASE b;   DERIVED d(tmp);   return 0;}}