Is this the correct way of using a void* member pointer?
<p>Can I use the method doSomething like this; first having assigned the pointer to the A class to the void* member of b?</p>

<pre><code>class A
{
    public:
        A(int);
        int m_x;
        int doSomething(){};
};

class B
{
    public:
        void* m_y;
};

#include "x.h"
using namespace std;

A::A(int x)
{
    m_x = x;
}

int main()
{
    //create 2 pointers to A and B
    B *b;
    A *a;

    b = new B();
    a = new A(15);

    b-&gt;m_y =  a;        

    ((A*)b-&gt;m_y)-&gt;doSomething();

    delete a;
    delete b;

   return 0;
}
</code></pre>
