Forum

static variable initialization bug?

This code prints "0" though it should print "1". struct X { int N; X() { static int n = 1 ; Print (n); } }; X x; void OnStart () { } This code prints "1". struct X { int N; X() { static int n = 1

Cloud Protector Bug?

Compiling the code below with MQL5 Cloud Protector on MetaEditor build 2302 fails with a message "protecting finished with error 'unknown' EX4 write error". void f( string s = NULL ) { Print ( StringLen (s) ); } The code below works. void f( string s = "" ) { Print ( StringLen (s) ); }

Bug: iMAOnArray doesn't recognize value update when working on array passed as an argument.

iMAOnArray returns wrong value when it is working on array passed as function 's argument. The code below shows that iMAOnArray returns diffrent result for argument array and local array though they are equal. It seems that iMAOnArray caches array data on first call of PrintArrayMA. loop0

Buggy constructor's behavior on MT4 build 880

I got recent update of MT4 build 880 and MetaEditor build 1173. I think I found a bug on class constructor's behavior. class Cls { public : Cls( const Cls* ptr) { Print (ptr == NULL ); } }; Cls c( NULL ); // Print result is "false" because 'ptr' is a bad pointer

Pointer array as a member behaves strange when passed to a function.

Pointer array doesn't work well when it is a member of a class or a struct. It returns bad pointers if it is passed to a function . Why??? class C { public : int c; }; struct S { C* array[ 2 ]; } s; void F() { s.array[ 0 ] = new C(); s.array[ 1 ] = new C(); G(s.array); } void G(C* &array[]) {