Is there a possibility to control multiple ( nested #include ) inclusions of .MQH header file in MQL4?
Do not worry about it. Everything will be compiled without problems.
PS See also #define and #ifdef.
jackee1234:
For MQL4, will it include the .mqh header files multiple times (or does it matter?), if say one header file makes use of the header files we already included?
If yes, how to prevent that?
Use #ifdef quard. Best programming practices suggest to wrap every header file source code into a construction like this
#ifndef _HEADER_ID_ #define _HEADER_ID_ ... actual source goes here #endif
Stanislav Korotky:
Use #ifdef quard. Best programming practices suggest to wrap every header file source code into a construction like this
Do we need to take care of this or just let mql4 take care of it (since it does not throw errors with multiple includes)?
jackee1234: Do we need to take care of this or just let mql4 take care of it (since it does not throw errors with multiple includes)?
| Unlike most other languages, MT4/5 guards itself.
|
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
For MQL4, will it include the .mqh header files multiple times (or does it matter?), if say one header file makes use of the header files we already included?
If yes, how to prevent that?