You're testing a local variable for a change. The local variable however won't change until you modify it in the corresponding function. You can either use a global variable instead or pass a pointer to the pointer to the function and check the variable this way.
Always learn from history, to be sure you make the same mistakes again...