Hello.
In my program I have tons, seriously, tons of global variables!
I've thought of some ways so as to decline their number.
Basically, I use all this global variables because I have the need to use them in multiple functions, this could be avoided if I used them as arguments when calling the functions which use the corresponding global variable. This is an idea, but it doesn't solve the problem completely.
For example, a function that shows me that in the GUI a button was pressed, and it is just a function (it doesn't take any arguments), cannot take as an argument the variable because it is meaningless!
To put it in other words, if I have such a function, which is not actually called from another function:
1 2 3
|
void on_button_3_clicked(){
//code here
}
|
, and inside this function I need to do a check, i.e. to check if something is true or false (which is declared on a global variable), then I don't know how can I avoid this.... :/ Any ideas?