Gholamhossein Eslamizadeh:
Hi,
I want to declare static field inside a class and access it across many instances. ( like java ) . but i see there are some practical limitaions! that I couldn't figure out!!! I know how it can be used in function but i want to use it as static field.
can you tell me how to do so. thanks in advance....
Read the documentation: Static Members of a Class
Static variables are referenced like this:
ClassName::StaticVarName
Documentation on MQL5: Language Basics / Object-Oriented Programming / Static Members of a Class
- www.mql5.com
Static Members of a Class - Object-Oriented Programming - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Drazen Penic:
Read the documentation: Static Members of a Class
Static variables are referenced like this:
thank you @ Drazen PenicXD
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I want to declare static field inside a class and access it across many instances. ( like java ) . but i see there are some practical limitaions! that I couldn't figure out!!! I know how it can be used in function but i want to use it as static field.
can you tell me how to do so. thanks in advance....