I read that global variables are not advised, so I have tried to use them the less I can, but there are always a few of them I need. Because I need speed code, I have the following question about global variables:
1) Why are they not advised?
2) Although I use they the less I can, what guidelines can I follow to use they in the best and efficient way?
3) Does using the 'restrict' keyword when declaring the var be good in order to get faster global variable management code.
4) Does has any sense to declare a global variable with the 'register' keyword?
5) I have read global vars are reloaded after a function call. Is there anyway this can avoided (when we now for sure that the called function does not modify that var)?