|
struct comm_part
{
void (*pFunc) (comm_part *pThis);
};struct big_part
{
struct comm_part comm; // обязательно первой
// another members
char a;
};void Loop (struct comm_part *pPart)
{
pPart->pFunc(pPart);
}void Handler (struct big_part *pPart)
{
if (pPart->a != 0) {
// lalalalallalalalal
}
}void main ()
{
struct big_part bp = { (void (*) (struct comm_part *)) Handler, 1};
Loop((struct comm_part *)&bp);
}
E-mail: info@telesys.ru