S samjesse Active Trader Aug 30, 2011 118 0 27 Jan 3, 2012 #1 Hi again I am not sure how to get MT5 to do this. MQL5: string s1="0110001"; string s2="0010101"; string s3=s1^s2; I expecting 0100100 many thx Last edited by a moderator: Sep 28, 2015
Hi again I am not sure how to get MT5 to do this. MQL5: string s1="0110001"; string s2="0010101"; string s3=s1^s2; I expecting 0100100 many thx
Enivid Administrator Staff member Nov 30, 2008 18,535 1,355 144 Odesa www.earnforex.com Jan 3, 2012 #2 First, 0110001^0010101 = 0010001, not 0100100. Second, you can't use strings for that. Have to use integers and only decimal or hex form. For example: MQL5: int a = 49; int b = 21; int c = a ^ b; // Should return 17. or: MQL5: int a = 0x31; int b = 0x15; int c = a ^ b; // Should return 0x11. Last edited: Sep 28, 2015
First, 0110001^0010101 = 0010001, not 0100100. Second, you can't use strings for that. Have to use integers and only decimal or hex form. For example: MQL5: int a = 49; int b = 21; int c = a ^ b; // Should return 17. or: MQL5: int a = 0x31; int b = 0x15; int c = a ^ b; // Should return 0x11.
S samjesse Active Trader Aug 30, 2011 118 0 27 Jan 3, 2012 #3 Enivid said: First, 0110001^0010101 = 0010001, not 0100100. [/code] Click to expand... isn't ^ mean xor? which is Input Output A B 0 0 0 0 1 1 1 0 1 1 1 0 ?? thx Last edited by a moderator: Sep 28, 2015
Enivid said: First, 0110001^0010101 = 0010001, not 0100100. [/code] Click to expand... isn't ^ mean xor? which is Input Output A B 0 0 0 0 1 1 1 0 1 1 1 0 ?? thx
Enivid Administrator Staff member Nov 30, 2008 18,535 1,355 144 Odesa www.earnforex.com Jan 3, 2012 #4 Oops, sorry. Confused it with "&" .