i'm using function pointers to dynamically call functions.
I have created a global object to store some settings in it.
Code: Select all
class Settings{
public:
Settings();
std::string getID();
private:
std::string ID;
};
Code: Select all
Settings *_settings;
....
setup(){
_settings = new Settings();
Serial.println(_settings->getID().c_str()); //PointA
}
...
void functionCalledFromPointer(){
Serial.println(_settings->getID().c_str()); //PointB
}
At PointB the content is emtpy.
What can i do to have the global objetc correctly accessable?
Best regards