EMBEDDED SYSTEMS & MICROCONTROLLERS · PAGE 87
C or C++? Code Size and Speed
Same hardware, different trade-offs.
Well-written C++ using classes, templates and constexpr produces code about as small as C. Features that add weight are exceptions, run-time type information and heavy standard library use.
Choose C for the smallest chips and C++ when structure helps a larger project. Always look at the linker map to see the actual cost.