Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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