Calculate which elements are missing in array2 compared to array1
The result should be: 6 и 7
This is what was brought up - there are language capabilities, but no "infrastructure" for solving elementary algorithmic problems. That's how much effort it takes to solve a given task in Python:
typedefvoid (*fn)( void * );
void f1 ( void * ) {}
class A {};
voidOnStart()
{
fn f2 = f1;
const A *a;
// f1( a ); //Error: 'a' - cannot convert from const pointer to nonconst pointer
f2( a ); //нет сообщения об ошибке ???
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
How can you compare two arrays?
are the elements unique?
yes
sort both arrays then look for the difference in one synchronous pass
How can I compare two arrays?
Calculate which elements are missing in array2 compared to array1
The result should be: 6 и 7
This is what was brought up - there are language capabilities, but no "infrastructure" for solving elementary algorithmic problems.
That's how much effort it takes to solve a given task in Python:
How much effort does it take to solve it in MQL?
Can thestandard library help somehow, or not?
I've looked through everything I can think of. Different languages have functions for this everywhere and it's really simple there...
I'm doing it in MQL4 ... need to make things as simple as possible.
I've looked through everything I can think of. Different languages have functions for it everywhere and it's really simple there...
I'm working in MQL4 ... need to make it as simple as possible.
Have a look at the standard library - look at CSortedSet and its ExceptWith method, it may help.
https://www.mql5.com/ru/docs/standardlibrary/generic/csortedset/csortedsetexceptwith
Have a look at the standard library - look at CSortedSet and its ExceptWith method, might help.
https://www.mql5.com/ru/docs/standardlibrary/generic/csortedset/csortedsetexceptwith
Thanks a lot !
It was solved in a much simpler wayNo error message
while constancy is violated
Here's a question:
how do I know what time the forex symbol closes?