-
Play videoPlease edit your post.
For large amounts of code, attach it.
- Mt4 doesn't have pointers to POD, only pointers to a classes.
class Buffer{ public: TYPE buffer[]; } class AAA { Buffer* buffer; void method_A(/*const*/ Buffer& buffer) { buffer = GetPointer(buffer); { double method_B(int idx) { return buffer.buffer[idx]; } };
Also Don't use const, as constant upcast won't compile [(const TYPE*)p] and koenig lookup is broken.
WHRoeder:
-
Play videoPlease edit your post.
For large amounts of code, attach it.
- Mt4 doesn't have pointers to POD, only pointers to a classes.Also Don't use const, as constant upcast won't compile [(const TYPE*)p] and koenig lookup is broken.
Thanks everybody, this is what I was afraid of. But with using struct I can't store the reference of Close, Open, High, ... or any of the indicator buffers.
gszabo:
I believe it is possible, otherwise none of my indicators with buffers would work.
Thanks everybody, this is what I was afraid of. But with using struct I can't store the reference of Close, Open, High, ... or any of the indicator buffers.
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
Hello,
does somebody know if it can be stored the value of a reference parameter which passes a dynamic array reference. Example:
class AAA{
??? Buffer;
void method_A(const double & buffer[])
{
Buffer = buffer;
{
double method_B(int idx)
{
return Buffer[idx];
}
};
void Proc()
{
AAA a = new AAA();
a.method_A(Close);
double x = a.method_B(20);
}
Thanks
Gabor