Timeline for How to Specify Array Length during Object Construction within Arduino IDE?
Current License: CC BY-SA 4.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 8, 2019 at 7:33 | history | edited | Edgar Bonet | CC BY-SA 4.0 |
Bugfix: delete → delete[].
|
| Jul 8, 2019 at 7:33 | comment | added | Edgar Bonet |
Oops! My bad. Turns out, with avr-gcc, operator delete and operator delete[] are implemented identically, as jmp free. But then, of course, this should not be relied upon. I fixed the answer.
|
|
| Jul 8, 2019 at 6:59 | comment | added | Nick Gammon♦ |
tttapa is right. That line should read: delete [] theArrayOfNumbers;
|
|
| Jul 8, 2019 at 1:38 | vote | accept | HarrisonO | ||
| Jul 7, 2019 at 22:56 | comment | added | tttapa |
Memory allocated using new[] has to be deleted using delete[], not delete.
|
|
| Jul 7, 2019 at 14:44 | comment | added | Edgar Bonet | @NickGammon: Good point. Added the link. | |
| Jul 7, 2019 at 14:44 | history | edited | Edgar Bonet | CC BY-SA 4.0 |
Link to previous answer.
|
| Jul 7, 2019 at 14:17 | comment | added | Juraj♦ | a note: for every use of the template with a different size, compiler generates a different class. every class takes space in program memory | |
| Jul 7, 2019 at 11:17 | comment | added | Nick Gammon♦ | As suggested in the previous answer - better to link to the answer. There is no such thing as permanent "previous" in Stack Exchange. The order of answers depends on the voting. Each answer has a share link which can be used to get a suitable link to it. | |
| Jul 7, 2019 at 10:45 | history | answered | Edgar Bonet | CC BY-SA 4.0 |