How could I initialize a static member of a inner class? I could not get information about that in the documentation nor in the forum.
class Outter {
static bool logical; public: class Inner { int integer; static float real; }; }; bool Outter::logical=true; // OK float Outter::Inner::real=1; // ERROR
Thanks in advance.
By the way, is not there a proper group for MQL5?
There is no such thing as "inner" class in mql5.
Then, what is the reason for allowing something like this without warnings nor errors?
class Outter { public: bool logical; private: class Inner { public: float real; }; public: Inner inner; private: static bool secret; }; void main(void){ Outter outter; outter.logical=true; outter.inner.real=1; }
It seems kind of nested classes.
Then, what is the reason for allowing something like this without warnings nor errors?
It seems kind of nested classes.
Yes, it looks like, but the class definition is always treated as if it were public and on the global level. The reason is unknown.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How could I initialize a static member of a inner class? I could not get information about that in the documentation nor in the forum.
class Outter {
static bool logical; public: class Inner { int integer; static float real; }; }; bool Outter::logical=true; // OK float Outter::Inner::real=1; // ERROR
Thanks in advance.
By the way, is not there a proper group for MQL5?