B
Bryan Parkoff
I set Function Pointer variable to private so unauthorized users cannot
access it, but they are allowed to use Get_ and Set_ functions to modify
Function Pointer variable. Look at my example.
unsigned char foo(void)
{
return 0xC1;
}
unsigned char (*pfoo)(void) = foo;
unsigned char* Get_foo(void)
{
// return pfoo; // Error -- can't return function pointer
return unsigned char (*pfoo)(void); // Error -- can't return function
pointer
}
Can you please correct Get_foo() function?
Bryan Parkoff
access it, but they are allowed to use Get_ and Set_ functions to modify
Function Pointer variable. Look at my example.
unsigned char foo(void)
{
return 0xC1;
}
unsigned char (*pfoo)(void) = foo;
unsigned char* Get_foo(void)
{
// return pfoo; // Error -- can't return function pointer
return unsigned char (*pfoo)(void); // Error -- can't return function
pointer
}
Can you please correct Get_foo() function?
Bryan Parkoff