Use pure virtual methods in an abstract class
<pre><code>#ifndef TEST_H
#define TEST_H
#include &lt;iostream&gt;
#include &lt;string&gt;
class A{
public:
    virtual void test1() = 0;
    virtual std::string test2() = 0;
};

class B : public A{

public:
     void test1(){
       std::cout &lt;&lt; A::test2() &lt;&lt; " World";
    }
};
class C : public B{
public:
     std::string test2(){
        return "hello";
    }
};
class C1 : public B{
public:
     std::string test2(){
        return "Sup";
    }
};

#endif // TEST_H
</code></pre>

<p>I have an interface A with only pure virtual methods. I have an abstract class that wants to implement <code>test1</code> and use <code>test2</code> for implementing <code>test1</code>.</p>

<p>Now C and C1 and my concrete classes that implement <code>test2</code></p>

<p>But I can't do <code>std::cout &lt;&lt; A::test2() &lt;&lt; " World";</code> in class B</p>

<blockquote>
  <p>error: cannot call member function 'virtual std::string A::test2()'
  without object</p>
</blockquote>

<p>How would I do something like this in c++?</p>
