question about updated object after it's be instantiated

Bare with me I'm a C guy not a C++ guy so my object knowledge is lacking. I'm using the simpleDSTadjust library on an esp8266 project i'm working on and I've creased a web page to adjust the DST settings. I'm able to adjust the settings and store them into the SPIFFS system as well as load those settings into variables in my code. The problem is now do I update the "DstRules" dynamically. I have a board I'm making that will be going out to multiple people and I want them to be able to adjust their dst settings without hard coding each board individually.

Here is a snippet of code from my work file:

#include <ESP8266WiFi.h>
#include <Ticker.h>
#include <time.h>
#include <simpleDSTadjust.h>

#define timezone -5 // US Eastern Time Zone
struct dstRule StartRule = {"EDT", Second, Sun, Mar, 2, 3600};    // Daylight time = UTC/GMT -4 hours
struct dstRule EndRule = {"EST", First, Sun, Nov, 2, 0};       // Standard time = UTC/GMT -5 hour


// Setup simpleDSTadjust Library rules
simpleDSTadjust dstAdjusted(StartRule, EndRule);

void setup() {

/****************************
*Here is where I want to update the StartRule and the EndRule and change it from EDT to say CDT
so i want to change the the 
StartRule = {"CDT", Second, Sun, Mar, 2, 1800};    // Daylight time = 30 minutes off CST
EndRule = {"CST", First, Sun, Nov, 2, 0};       // Standard CST time 
****************************/


  updateNTP(); // Init the NTP time
  printTime(0); // print initial time time now.

}

I throw an error on both the StaruRule and EndRule in the setup function via the compiler if I try to do this.

First of all, if you’re asking for help with a compiler error, it make tremendously more sense to post a COMPLETE program rather than a snippet. There’s no way a snippet can compile, so there’s no way for anyone to check out the compiler errors that you are seeing with your complete program.

To your question, you can’t update structures that way at run time just like you can’t do it in good ‘ole C either. You must do it element-by-element. Look in the simpleDSTadjust.h file to find the definition of the dstRule structure.

But, even if you update the structures, it doesn’t update the simpleDSTadjust object you made with them. I’d create the object dynamically:

simpleDSTadjust *dstAdjustedPtr;

void setup() {
  struct dstRule StartRule;
  struct dstRule EndRule;

  // Fill in StartRule and EndRule here using run-time information.

  // Create the simpleDSTadjust object
  dstAdjustedPtr = new simpleDSTadjust(StartRule, EndRule);
}

void loop() {
}

The dstAdjustedPtr variableis a pointer. So, dereference it with ‘dstAdjustedPtr->’

Sorry not trying to fix a compiler error I know the way I was trying to do things was all wrong in the first place.

Thanks for the example it helped me understand how to make an object dynamic and solved my problem. SEE the snippet was all i needed.