I need help on how to read and reset a value which points to a function here is an example on what i need
//this is what i have now that sets up a global variable
void setfunctionaddress(void (*myfuncaddress)(void))
{
workarea[selected]->data = myfunctionaddress
}
void firstfunction(void)
{
do something
}
void secondfunction(void)
{
do something new
}
//start of example
//#1 i need to setup setfunctionaddress
//#2 need to be able to read/save address what is stored
//#3 need to set setfunctionaddress to new value
//#4 neet to reset setfunctonaddress back from read/save
main()
{
setfunctionaddress(firstfunction);
jumptofunction();
}
void jumptofunction(void)
{
//this is what i need to do
//READ what is stored at setfunctionaddress
setfunctionaddress(secondfunction);
do something
//RESET setfunctionaddress to what was READ
return;
}
//this is what i have now that sets up a global variable
void setfunctionaddress(void (*myfuncaddress)(void))
{
workarea[selected]->data = myfunctionaddress
}
void firstfunction(void)
{
do something
}
void secondfunction(void)
{
do something new
}
//start of example
//#1 i need to setup setfunctionaddress
//#2 need to be able to read/save address what is stored
//#3 need to set setfunctionaddress to new value
//#4 neet to reset setfunctonaddress back from read/save
main()
{
setfunctionaddress(firstfunction);
jumptofunction();
}
void jumptofunction(void)
{
//this is what i need to do
//READ what is stored at setfunctionaddress
setfunctionaddress(secondfunction);
do something
//RESET setfunctionaddress to what was READ
return;
}