How can C++ make it possible to use dynamic container classes even in embedded systems?
Background info:
I've been working with PIC (C) and AVR (C++) processors and at the moment (PIC C) I'm trying to send a text (with undefined length) to a method that only sends this string with a HTTP POST (so it has to know the length beforehand).
Problem & question:
On C++ this could easily be achieved with a container class/dynamic array. Though, when using C, I (guess) I'm continiously overwriting memory addresses (When I use a pointer and then change the length)?
How does C++ (efficiëntly?) manage dynamic arrays? Are all bits off the dynamic array scattered throughout your memory and how does it find these back? Or does it secretly allocate memory/blocks of memory?
malloc
/realloc
or their C++ equivalents.