- p is a single _S; it is not a pointer. arr is an dynamic array of _S.
- &arr[2] is what you do in C++ create a pointer; taking the address of arr[2]. MQL4 doesn't have pointers (except to classes.)
- What are you trying to do?
WHRoeder:
- p is a single _S; it is not a pointer. arr is an dynamic array of _S.
- &arr[2] is what you do in C++ create a pointer; taking the address of arr[2]. MQL4 doesn't have pointers (except to classes.)
- What are you trying to do?
add 3) I would like to have a simple access to complex structures.
add 2) I had the suspicion there are no pointers in MQl4 except to classes AND except to function calls! So I tried whether this might already (b+600) has been changed and someone has found that hidden feature.
add 1) I know, but I tried to use something others might understand what I'd like to have - due to MQL4's function calls with arrays, structs, ...
You can only have pointers to classes as Structures and Classes - MQL4 Documentation says
the new operator can be applied to class objects; this operator cannot be applied to structures;
Function calls are irrelevant. class T{ public: int v; }; void OnStart() { T arr[3]; for(int i=0; i < 3; ++i){ arr[i].v = i; T* p = GetPointer(arr[i]); Print(p.v); // 0, 1, 2 }

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
Hi,
am I right that we cannot have this kind of pointer structure?
Is there another way than using a function (that requires calls by reference)?