#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct A;
typedef void (*func_t)(struct A*);
struct A
{
func_t functionPointerTable[10];
int value;
};
void print_stdout(struct A* a)
{
printf("stdout: %d\n", a
->value
); }
void print_stderr(struct A* a)
{
fprintf(stderr
, "stderr: %d\n", a
->value
); }
int main()
{
struct A myA = { {print_stdout, print_stderr}, 4 };
myA.functionPointerTable[0](&myA);
myA.functionPointerTable[1](&myA);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgoKc3RydWN0IEE7Cgp0eXBlZGVmIHZvaWQgKCpmdW5jX3QpKHN0cnVjdCBBKik7CgpzdHJ1Y3QgQQp7CiAgICBmdW5jX3QgZnVuY3Rpb25Qb2ludGVyVGFibGVbMTBdOwogICAgaW50IHZhbHVlOwp9OwoKdm9pZCBwcmludF9zdGRvdXQoc3RydWN0IEEqIGEpCnsKICAgIHByaW50Zigic3Rkb3V0OiAlZFxuIiwgYS0+dmFsdWUpOwp9Cgp2b2lkIHByaW50X3N0ZGVycihzdHJ1Y3QgQSogYSkKewogICAgZnByaW50ZihzdGRlcnIsICJzdGRlcnI6ICVkXG4iLCBhLT52YWx1ZSk7Cn0KCmludCBtYWluKCkKewogICAgc3RydWN0IEEgbXlBID0geyB7cHJpbnRfc3Rkb3V0LCBwcmludF9zdGRlcnJ9LCA0IH07CgogICAgbXlBLmZ1bmN0aW9uUG9pbnRlclRhYmxlWzBdKCZteUEpOwogICAgbXlBLmZ1bmN0aW9uUG9pbnRlclRhYmxlWzFdKCZteUEpOwogICAgcmV0dXJuIDA7Cn0KCg==