I'm using a 3rd party library in which a method is declared this way:
void nexLoop(NexTouch *nex_listen_list[]);
In case of a single .cpp file, this is working:
NexButton b0 = NexButton(0, 1, "b0");
NexTouch *nex_listen_list[] =
{
&b0,
NULL
};
...
nexLoop(nex_listen_list);
Full example code can be seen here: https://github.com/itead/ITEADLIB_Arduino_Nextion/blob/master/examples/CompText/CompText.ino
Now I'm incorporating this library in a class which has a separate header and c file, so that:
MyNextion.h
#include "Nextion.h"
class MyNextion {
public:
MyNextion();
void loop();
private:
NexButton *b0;
NexTouch *nex_listen_list[];
}
MyNextion.cpp
#include "MyNextion.h"
MyNextion::MyNextion() {
b0 = new NexButton(0, 1, "b0");
nex_listen_list = new ???
}
MyNextion::loop() {
nexLoop(nex_listen_list); // ???
}
I was messing around with pointers and address operators but I couldn't find the right combination to a successful compilation.
My question is: what would you put here: nex_listen_list = new ???;
Also, I'm not sure the title well defines my problem. Please correct it if you have a better idea for the title.
Thank you!