In general, I know that global variables are bad and their should be avoided. Are static global variables equally bad?
In all my projects, I have heavily relied on static global variables. From design perspective, how can I avoid using them.
Ex Use case :
Whenever the key is changed(by some other threads), my call back notifier is executed in which I update my static global variable with the new key. This key is used everywhere in the program to decrypt some data.
How can I avoid static globals in this case?