来自一个 "傻瓜 "的问题 - 页 104

 
220Volt:
谢谢,看来是时候烧掉曾祖父的书了 ))))

从历史上看:曾祖父的书专门为旧软件的兼容性留下了长=int。

我们曾一度决定--将 "无用 "的long作为int,并引入不人道的int64(或long int),或者通过使用纯long来 "正确 "行事。因此,我们决定,正确的程序是将long作为一个64位的整数。

在其他系统中,长不一定是32位。即使是同一个编译器在不同的架构上使用不同的尺寸。这就是英特尔C++的特点。

The size of a "long" integer varies between architectures and operating systems.

The Intel Compiler is compatible and inter-operable with Microsoft* Visual C++ on Windows* and
with gcc* on Linux* and Mac OS X*. Consequently, the sizes of fundamental types are the same as
for these compilers. The size of  a long integer in particular depends on the operating system
and the targeted architecture as follows:

   OS         arch           size
----------------------------------
Windows       IA-32        4 bytes
Windows       Intel 64     4 bytes
Windows       IA-64        4 bytes
Linux         IA-32        4 bytes
Linux         Intel 64     8 bytes
Linux         IA-64        8 bytes
Mac OS X      IA-32        4 bytes

Mac OS X        Intel 64       8 bytes


在MQL5中,我们使用x64位兼容架构,要求在32位和64位都有相同的行为。long是64位,也是这个原因。


如果你还记得的话,再讲一点历史:在MSDOS时代,int是16位的,在16位编译器中等于short。当程序员转移到32位平台时,int被扩展到32位,变成了等于short。似乎没有什么特别的抱怨。当我们转移到64位时,long必须从int中分离出来。而且这也是符合逻辑的。

 

MqlRates rates[];

我需要找到 过去三个条形图中 rates[].high 的最大值

我不知道如何对结构 应用ArrayMaximum?

 
dentraf:

MqlRates rates[];

我需要找到 过去三个条形图中 rates[].high 的最大值

我不知道如何对结构 应用ArrayMaximum?

据我所知,这个函数只对数字数组起作用,所以要写自己的函数来扰乱结构。
 
dentraf:

MqlRates rates[];

我需要找到 过去三个条形图中 rates[].high 的最大值

我不知道如何对结构 应用ArrayMaximum?

double MaxHigh(const MqlRates& rates,int &index)
  {
   double max=0.0;
   index=-1;
//--- check
   if(ArraySize(rates)<3) return(EMPTY_VALUE);
//--- loop
   for(int i=0;i<3;i++)
      if(max<rates[i].high)
        {
         max=rates[i].high;
         index=i;
        }
//--- result
   return(max);
  }
它是这样的。ArrayMaximum并不适用于该结构。
 
uncleVic:
类似这样的事情。ArrayMaximum并不适用于该结构。
谢谢你!
 

它是什么意思?

CExpertBase::SetOtherSeries: 禁止改变时间序列

 
CExpertBase::SetOtherSeries: 更改时间序列是被禁止的
这意味着什么?
 

请告诉我。

鉴于。

  • 两个过程(#1和#2)。
  • 并行运行。
  • UE的内存空间。
  • 在一个时刻(在一个周期),这些进程试图做以下事情。

1.No.1写给UE,No.2读。

2.将#1和#2写入UE中。

问题:哪种情况是冲突的?我对案例1更感兴趣,我们可以认为它是正常的,还是应该限制访问?我怀疑第1种情况不好,冲突会是什么样子,价值不明确,还是期待更严重的事情?

 
openlive:
CExpertBase::SetOtherSeries: 禁止更改时间序列
这意味着什么呢?
更详细一点...日志中的下一行(最好是几行)是什么?
 

220Volt:

问题:哪种情况是冲突?我对案例1更感兴趣,这可以被认为是正常的,还是应该限制访问?我怀疑情况1不好,冲突会是什么样子,一个不明确的数值,还是我应该期待更严重的事情?

这两种情况都会有冲突,价值不明确。