#include <iostream>

extern "C"
{
    typedef void call_back( const void*, int ) ;

    void c_fun( call_back function, const void* arg1 )
    {
        for( int i = 0 ; i < 4 ; ++i ) function( arg1, i ) ;
    }
}

struct A
{
    void foo( int value ) const { std::cout << "void A::foo(int) const - value == " << value << '\n' ; }
};

extern "C"
{
    void call_A_foo( const void* This, int v ) { static_cast< const A* >( This )->foo(v) ; }
}

int main()
{
    A a ;
    c_fun( call_A_foo, &a ) ;
}
