Current location - Loan Platform Complete Network - Foreign exchange account opening - EA Global Variables in MT4
EA Global Variables in MT4
Oh, I've been concerned about this problem for a long time. Why didn't anyone answer? I collected some information about extern and found that almost all of them are modification methods. I don't know what's the point of modifying variables directly.

I wonder if it can be understood like this:

Because the scope of extern is the whole project and it is public, this variable can be used in class B without instantiation. Because a is not instantiated, AccountBalance is unknown to class B, so of course it can't be written like this. As for the solution, I think you will know when you understand the principle.