Constants in MQL4
Just a quick question
Is there a way of defining a constant? What I mean is defining something like
int a = 5;
and defining it in such a way that it cannot be altered or if an attempt was made to alter it an error would be generated.
- Big changes for MT4, in a few weeks
- Discussion of article "Change Expert Advisor Parameters From the User Panel "On the Fly""
- Is there a way to alter 'extern vars'.. ?!
Use #define instruction. Constant declaration
Hi Rosh - thanks that works.
I didn't think that method would generate an error if an attempt was made to alter its value but I just tried it out and if you try to alter its value the code won't compile so that is fine. Thanks.