// .c文件
unsigned char add(unsigned char a, unsigend char b)
{
return a + b;
}
testfun testfun1 = {
.major = 2,
.minor = 3,
.addfunction = &add3
};
int main()
{
int a = testfun1.addfunction(2,3);
return 0;
}
//.h文件
unsigned char add3(unsigned char a,unsigned char b);
typeddef struct
{
unsigned char major;
unsigned char minor;
unsigned char (*addfunction)(unsigned char a, unsigend char b);
} testfun;