Yes, I know that property, thank you. But it implies that the icon has to be at the user. Is there any way around this? So that the person only downloaded ex4 and my image is displayed to him?
If you have specific array cells allocated to each type, then make a structure instead of an array.
I thought of doing that, but I lost the link where the person put the elements from the structure into the structured array. He declared a structure and then created an array and under each number was stored type int string double, but there he had an array with only one different element in each cell, so I thought it was possible here too, but apparently not.
#include "stdafx.h"#include <conio.h>
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
template<typename T> void Fun(T a[],size_t m=2,size_t n=2, T r=0)
{
for ( size_t i = 0; i < m; i++ )
{
for ( size_t j = 0; j < n; j++ )
{
(a[i * n + j ])=(a[i * n + j ])*5;
cout <<(a[i * n + j ])<<" "<<endl;
}
}cout<<endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
int mas[6]={1,2,3,4,5,6};
double mas1[2][2]={{1.4,4.2},{2.8,6.7}};//int //{{},{}};int mas2[2][2][2];
Fun(*mas1);//Для 2умерного массива передача по ссылке, но в mql4 все массивы передаются по ссылке
Fun((mas),6,1);
for(int i=0;i<2;i++)
{for(int t=0;t<2;t++)
{cout<<mas1[i][t]<<" "<<endl;}}
_getch();
return0;
}
In this example I passed a 2-dimensional and a 1-dimensional array into the function, and by the way this is my code.
Here's another example of what mql4 can't do.
#include <iostream>
#include <variant>
using double_bool_int = std::variant<double, bool, int>;
int main()
{
const size_t len = 15 u;
double_bool_int* arr = new double_bool_int[len];
{
size_t idx = 0 u;
for (; idx < 5 u; ++idx)
arr[idx] = static_cast<double>(0.5 * idx);
for (; idx < 10 u; ++idx)
arr[idx] = static_cast<bool>(idx & 1 u);
for (; idx < 15 u; ++idx)
arr[idx] = static_cast<int>(2 * idx);
}
for (auto it = arr; it != arr + len; ++it)
{
if (const auto i = std::get_if<int>(it); i)
std::cout << "int " << *i << "\n";
elseif (const auto d = std::get_if<double>(it); d)
std::cout << "double " << *d << "\n";
elseif (const auto b = std::get_if<bool>(it); b)
std::cout << "bool " << std::boolalpha << *b << "\n";
}
delete[] arr;
return0;
}
Which of these can mql4 or here's an example
double f(double n, ...) //--заголовок с переменным числом параметров
{ double *p = &n; //--установились на начало списка параметровdouble sum = 0, count = 0;
while (*p) //--пока аргумент не равен нулю
{ sum+=(*p); //--суммируем аргумент
p++; //--«перемещаемся на следующий аргумент
count++; //--считаем количество аргументов
}
return ((sum)?sum/count:0); //--вычисляем среднее
}
Yes, I know that property, thank you. But it implies that the icon has to be at the user. Is there any way around this? So that the person only downloaded ex4 and my image is displayed to him?
Yes, I know that property, thank you. But it implies that the icon has to be at the user. Is there any way around this? So that the person only downloaded ex4 and my image is displayed to him?
Igor Makanu: Well, if this is your code, then compile it into a .dll and connect it to MQL, the "two clicks" work, incomprehensible discussion for three months
The problem is that I apply templates to all functions that take arrays, and export and import of template functions is not possible it will have to duplicate functions for each type, the same situation with dimensionality mql does not want to give them just like that and again I have to duplicate them by dimensionality turns out a kind of overload but add additional arguments is not necessary nevertheless this is also excessive code, as for increasing function arguments mql also will not give just the data I have to duplicate functions do overload So I don't think it's worth it, I thought about writing my own language but then again I wrote 15% of my robot and spent more than a year to calibrate everything and make it as universal as possible and provide fast performance and 3 years for calculations. I just don't have enough life to write my own language. So there you go.
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.
The question is purely one of aesthetics.
How do I make it so that there is a picture of its own here? MT4
Yes, I know that property, thank you. But it implies that the icon has to be at the user. Is there any way around this? So that the person only downloaded ex4 and my image is displayed to him?
If you have specific array cells allocated to each type, then make a structure instead of an array.
I thought of doing that, but I lost the link where the person put the elements from the structure into the structured array. He declared a structure and then created an array and under each number was stored type int string double, but there he had an array with only one different element in each cell, so I thought it was possible here too, but apparently not.
What has been cut, exactly?
In this example I passed a 2-dimensional and a 1-dimensional array into the function, and by the way this is my code.
Here's another example of what mql4 can't do.
Which of these can mql4 or here's an example
Yes, I know that property, thank you. But it implies that the icon has to be at the user. Is there any way around this? So that the person only downloaded ex4 and my image is displayed to him?
Yes, I know that property, thank you. But it implies that the icon has to be at the user. Is there any way around this? So that the person only downloaded ex4 and my image is displayed to him?
It doesn't.
Attach a picture with a resource.
For an icon, it won't work.
#property icon already packs the icon in ex
and that's my code, by the way.
Doesn't imply.
Thanks, figured it out, it's been an eye-opener.
Well, if this is your code, then compile it into a .dll and connect it to MQL, the "two clicks" work, incomprehensible discussion for three months
The problem is that I apply templates to all functions that take arrays, and export and import of template functions is not possible it will have to duplicate functions for each type, the same situation with dimensionality mql does not want to give them just like that and again I have to duplicate them by dimensionality turns out a kind of overload but add additional arguments is not necessary nevertheless this is also excessive code, as for increasing function arguments mql also will not give just the data I have to duplicate functions do overload So I don't think it's worth it, I thought about writing my own language but then again I wrote 15% of my robot and spent more than a year to calibrate everything and make it as universal as possible and provide fast performance and 3 years for calculations. I just don't have enough life to write my own language. So there you go.