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
Hey all,
could please someone help me ? Guess i didn't got the concept completly.
I have a class which should handle my buffer data. I want to pass a array to this class and set the pointer to a internal variable.
Like this:
// add a object to list
class1 object = new class1;
// create a array
double arrayRef[];
// pass array
object.setArrayRef (arrayRef);
The class looks like this:
class class1 {
public:
void class1() {};
void ~class1() {};
// var & functions
double buffer[];
double setArrayRef (double &arrayRef[]);
};
double class1::setArrayRef (double &arrayRef[]) {
my_buf.buffer = arrayRef;
}
When i do this, i get the error message:
'buffer' - invalid array access array_struct_ref_simple.mq5
Do i do something wrong or do i think on the wrong way ? Passing a array ref and work with the is fine, but this not.
My idea was like, setting once the pointer and having functions like getGreatestValue(), sortValues() etc ...which can work with the pointer.
Thanks