#include <stdio.h>
typedef int (*myType)(int);
int addFive(int seed)
{
return seed + 5;
}
void PrintInt(int number, myType HandleFunc)
{
int resultValue = HandleFunc(number);
printf("%d\r\n", resultValue
); }
int main(void) {
int value = 10;
myType myFunc = addFive;
printf("%d\r\n", (*myFunc
)(value
)); PrintInt(value, addFive);
PrintInt(value, &addFive);
// your code goes here
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIGludCAoKm15VHlwZSkoaW50KTsKCmludCBhZGRGaXZlKGludCBzZWVkKQp7CglyZXR1cm4gc2VlZCArIDU7Cn0KCnZvaWQgUHJpbnRJbnQoaW50IG51bWJlciwgbXlUeXBlIEhhbmRsZUZ1bmMpCnsKCWludCByZXN1bHRWYWx1ZSA9IEhhbmRsZUZ1bmMobnVtYmVyKTsKCXByaW50ZigiJWRcclxuIiwgcmVzdWx0VmFsdWUpOwp9CgppbnQgbWFpbih2b2lkKSB7CglpbnQgdmFsdWUgPSAxMDsKCW15VHlwZSBteUZ1bmMgPSBhZGRGaXZlOwoJcHJpbnRmKCIlZFxyXG4iLCAoKm15RnVuYykodmFsdWUpKTsKCVByaW50SW50KHZhbHVlLCBhZGRGaXZlKTsKCVByaW50SW50KHZhbHVlLCAmYWRkRml2ZSk7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglyZXR1cm4gMDsKfQo=