Go Down

Topic: Error: expected '}' before '{' token (Read 157 times) previous topic - next topic

mattlogue

Error: expected '}' before '{' token

There clearly is a '}' at the end of that first line! Its a 5x35 array. Compiling for an ESP12E. I know i shoud not use String, but is it worse than using char pointers in unallocated mem blocks...

Code: [Select]
const     String    eAddrNames[5][EADDR_SZ] = { { "RESERVED" }
                        { "dailyEmails", "emailsCount", "fanEvery", "fanFor", "fanMode", "fanPostMixTime", "fanTimeout", "HHOffset", "hysteresis", "lastEmailHour", "lastIssueCodeI", "minsFan", "minsCool", "minsHeat", "lock", "MMOffset", "temperature", "temperatureSet", "tempX", "timeBlocks", "tempTimeout", "timeNTP", "lastVersionDayA", "version2A", "version3A", "lastVersionDayB", "version2B", "version3B", "RESERVED_INT", "RESERVED_INT"}
                        { "unlockTime", "codeMS", "epoch", "longmillis", "lastEmailMS", "lastIssueMS", "myResetMS", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG" }
                          { "APPass", "ATTPass", "BIPass", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10" }
                          { "RESERVED_STRING20", "RESERVED_STRING20", "RESERVED_STRING20", "RESERVED_STRING20" } };
Just because I live in the states don't mean I care

GoForSmoke

troll

Code: [Select]

const     String    eAddrNames[5][EADDR_SZ] = { { "RESERVED" }
                        { "dailyEmails", "emailsCount", "fanEvery", "fanFor", "fanMode", "fanPostMixTime", "fanTimeout", "HHOffset", "hysteresis", "lastEmailHour", "lastIssueCodeI", "minsFan", "minsCool", "minsHeat", "lock", "MMOffset", "temperature", "temperatureSet", "tempX", "timeBlocks", "tempTimeout", "timeNTP", "lastVersionDayA", "version2A", "version3A", "lastVersionDayB", "version2B", "version3B", "RESERVED_INT", "RESERVED_INT"}
                        { "unlockTime", "codeMS", "epoch", "longmillis", "lastEmailMS", "lastIssueMS", "myResetMS", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG", "RESERVED_LONG" }
                          { "APPass", "ATTPass", "BIPass", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10", "RESERVED_CHAR10" }
                          { "RESERVED_STRING20", "RESERVED_STRING20", "RESERVED_STRING20", "RESERVED_STRING20" } };
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

mattlogue

Just because I live in the states don't mean I care

Montmorency

#3
Apr 18, 2019, 05:25 am Last Edit: Apr 18, 2019, 05:28 am by Montmorency
Um, aggregate initializers are supposed to be separated by commas. Where are your commas?

Code: [Select]
const String eAddrNames[5][EADDR_SZ] = { { "RESERVED" }, // <- comma
    { "dailyEmails", "emailsCount", "fanEvery", "fanFor", "fanMode", "fanPostMixTime", "fanTimeout",
      "HHOffset", "hysteresis", "lastEmailHour", "lastIssueCodeI", "minsFan", "minsCool", "minsHeat",
      "lock", "MMOffset", "temperature", "temperatureSet", "tempX", "timeBlocks", "tempTimeout",
      "timeNTP", "lastVersionDayA", "version2A", "version3A", "lastVersionDayB", "version2B",
      "version3B", "RESERVED_INT", "RESERVED_INT"}, // <- comma
      ...
      // and so on
      ...
 };

mattlogue

I missed the commas between the dimensions. Darn, thanks!
Just because I live in the states don't mean I care

GoForSmoke

I know i shoud not use String, but is it worse than using char pointers in unallocated mem blocks...

because whatever you do, don't define char arrays then use those or even more, don't put const chars in PROGMEM.

Load up your RAM with data you already have a copy of and be sure to use C++ convenience objects to trash the heap.

1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

mattlogue

Yep
because whatever you do, don't define char arrays then use those or even more, don't put const chars in PROGMEM.

Load up your RAM with data you already have a copy of and be sure to use C++ convenience objects to trash the heap.


Just because I live in the states don't mean I care

GoForSmoke

You should know better after all this time, hence Reply #1.

Quote
That's hardly helpful.
I'm hardly helping you shoot your own foot. Noted.
1) http://gammon.com.au/blink  <-- tasking Arduino 1-2-3
2) http://gammon.com.au/serial <-- techniques howto
3) http://gammon.com.au/interrupts
Your sketch can sense ongoing process events in time.
Your sketch can make events to control it over time.

Go Up