/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

struct C;

typedef void (*fptr1)(struct C **this, int v); // C++ API in C
typedef void (*fptr2)(struct C **this, char *s); // C++ API in C

struct C_vtable
{
    fptr1 M1;
    fptr2 M2;
};

struct C
{
    struct C_vtable *vtable;
};

void f(struct C **o)
{
    (*o)->vtable->M1(o, 123);
    (*o)->vtable->M2(o, "ABC");
}
