#define A 0x1 #define B 0x2and
int X = A|B;
Is it A/B?
Is it A/B?
No, I am trying to perform a bitwise operation while defining the default value of a global variable.
No, I am trying to perform a bitwise operation while defining the default value of a global variable.
It's not a Global variable, it's a globally declared variable or a variable with global scope . . . this is a Global Variable . . . please use the correct terminology to be clear.
Why are you declaring it as an extern ? and how do you expect to assign an expression to an extern ? can you ?
#define A 0x1 #define B 0x2 #define AorB 0x3 extern int X = AorB;
RaptorUK, in terms of programming this is a global variable, since it's accessible by all functions in the program.
The global variable in MT4 is actually a shared memory that can be accessed by different custom indicators or ea's.
WHRoeder, thanks for clearing it up. I guess that MQL4 lacks some useful features :/.
RaptorUK, in terms of programming this is a global variable, since it's accessible by all functions in the program.
The global variable in MT4 is actually a shared memory that can be accessed by different custom indicators or ea's.
It makes me wonder why MQ didn't refer to GlobalVariableSet() [variables] by a different name.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I try to define a global variable with initial value like this:
I get a compilation error that says that , or ; are expected instead of the |.
When trying to to the same in a function, everything works great:
Am I doing something wrong?
Thanks.