Callback function and global Variable
Posted on 2003-10-28
ok i have an app similiar to one down here....I am trying to access global variable from a call back function after modifying the variable before Callback function is invoked, why didn;t i get the updated value?
static int gNum = 5;
main( void )
gNum = 5;
InvokeCallback( CallbackFunc );//Calls CallbackFunc
static void CallbackFunc( void ** ptr)//this parameter is irrelevant to the question
//Here I am trying to access gNum, I was expecting gNum to be 5, but i got 0.????