How to use a local variable in another function MQL4/MQL5/C++
I am trying to use my variable switch_action which is computed in the zmq code (InterpretZmqMessage) and use it in my second function (secondfunction)
I have tried global variables by creating them in the zmq function and using them in the second function but aside from being poor coding practice, they led to further issues such as my other functions not working.
For this problem, I was researching into pointers and tried to implement them but to my avail, they did not work. I apologize, I am relatively new to this language so it is difficult for me to solve this problem on my own.
I don't think you have enough threads open to discuss this topic. Perhaps you'd get a better answer if you open more...
I have tried global variables by creating them in the zmq function and using them in the second function but aside from being poor coding practice, they led to further issues such as my other functions not working.
For this problem, I was researching into pointers and tried to implement them but to my avail, they did not work. I apologize, I am relatively new to this language so it is difficult for me to solve this problem on my own.