It is perfectly possible to use dynamic memory management in embedded situations - you just need to be careful how you do it. In this case, using malloc()
and free()
is likely easier, though to help with compatibility you may want to define them as new
and delete
. A good source of information on the topic is over at AVR Freaks.
The reason these operators don't exist is simply that AVR-GCC does not fully support C++, only parts of it. This is partly due to the nature of embedded programming - some of the more advanced C++ features can rapidly chew up flash memory and RAM. The C vs C++ on embedded platforms argument is an old and often heated one, but usually comes down to the situation. Here is another another forum topic on the subject.