ReLor2:
Hi,
only a short basic question.
I create a struct. In the array i only store 1 row (1 element each), how i can access them.
Hi,
only a short basic question.
I create a struct. In the array i only store 1 row (1 element each), how i can access them.
I can access with
Is it possible to do it only with "my_data_struct.field1"?
my_struct_var = my_struct_arr[0];
my_struct_var.field_1
ReLor2:
I can access with
my_data_struct[0].field1
Is it possible to do it only with "my_data_struct.field1"?
No.
the array name is
my_data_struct my_data[];
so you access it with the array name
my_data[0].field1
Avoid using such similar names, it can be confusing.
Keith Watford #:
No.
the array name is
so you access it with the array name
Avoid using such similar names, it can be confusing.
Hi,
sorry you've right, i typed it wrong.
So, is it possbile to acees by
my_data.field1
instead
my_data[0].field1
?
And by the way, is there a way to prefill the stuct array with datas for the first element ([0]) ?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
only a short basic question.
I create a struct. In the array i only store 1 row (1 element each), how i can access them.
I can access with
my_data_struct[0].field1
Is it possible to do it only with "my_data_struct.field1"?