Questions from a "dummy" - page 171

 
fyords:

When count is divisible by a hundred (100,200,300...) the condition will be triggered, i.e. the remainder will be zero.

I.e. multiplicity 100, in all other cases it will be like 2.5, 4.6, etc. - the remainder will be 0.5 and 0.6 respectively.

The remainder of division only works for integers, so 0.5 and 0.6 cannot be, but otherwise it is correct.
Документация по MQL5: Основы языка / Операции и выражения / Арифметические операции
Документация по MQL5: Основы языка / Операции и выражения / Арифметические операции
  • www.mql5.com
Основы языка / Операции и выражения / Арифметические операции - Документация по MQL5
 
Urain:
The remainder of division only works for integers, so 0.5 and 0.6 can't be, but otherwise it's correct.
Yes, indeed, and it seemed to work that way in C++. And yes, the example is not very good, but it is clear and understandable.
 

Please help in C++: is it possible to specify an enum type? For example, I don't want 4 bytes, but one or eight.

 

Clearly not -- the type is generated based on the values. There may be a minimum size (4 bytes)

But by setting specific values, the type can be controlled.

Better double-check, may have forgotten. There seems to be some tricky stuff with signed unsigned.

 
TheXpert:

Clearly not -- the type is generated based on the values. There may be a minimum size (4 bytes)

But by setting specific values, the type can be controlled.

Better double-check, may have forgotten. There seems to be some tricky stuff with signed unsigned.


Thanks, it's always 4, at least for me :)

 
220Volt:

Here's what I found:


Currently C++ doesn't support this. C++0X will support this, using this syntax:

enum class Enum2 : __int64 {Val1, Val2, val3};
 
220Volt:

Please help in C++: is it possible to specify an enum type? For example, I don't want 4 bytes, but one or eight.

Basic C++ types

Data type Bytes Bits Min Max
signed char 1 8 - 128 127
unsigned char 1 8 0 255
signed short 2 16 -32768 32767
enum 2 16 -32768 32767
unsigned short 2 16 0 65535
signed int 2 16 -32768 32767
unsigned int 2 16 0 65535
signed long 4 32 -2147483648 2147483647
unsigned long 4 32 0 4294967295
Основные типы C++
  • citforum.ru
Внимание! Любой из материалов, опубликованных на этом сервере, не может быть воспроизведен в какой бы то ни было форме и какими бы то ни было средствами без письменного разрешения владельцев авторских прав. Подробнее...
 

Hello.

I threw new indices in the folder C:{Program Files\InstaTrader 5\MQL5\Indicators\Examples, but they are not visible in the terminal?

What's the problem?

 
Vin22:

Hello.

I threw new indices in the folder C:{Program Files\InstaTrader 5\MQL5\Indicators\Examples, but they are not visible in the terminal?

Please tell me what's wrong.

The terminal uses a different folder.

If you run it with the /portable switch, it will use its own folder.

D:\.....\terminal.exe /portable

 
220Volt:

Thanks, always 4, at least for me :)

Just checked in VS2010 :) it works.

enum Enum2 : char {Val1, Val2, Val3};

It gives out sizeof == 1.

Reason: