Object Oriented programming is only a style, but there are languages such as C++ which have tailored themselves to that style, making it exponentially easier to program, ex. the entire class structure.
Object Oriented programming is only a style, but there are languages such as C++ which have tailored themselves to that style, making it exponentially easier to program, ex. the entire class structure.
It's not because C++ is too bloated. It's just that it's easier to create a C compiler than a C++ compiler, and since embedded programs are typically small - no one complainsIf you're programming on microcontrollers and the like, you are more likely to be using C than C++ (as it is, I believe, considered too bloated for such applications), but perhaps someone with more experience with this can elaborate.
The size and memory usage of a C++ progarm compared to a similar C program is larger on both cases (most of the time). So there are times when it comes down to needing a smaller package. Considering the vast number of platforms that GCC can compile to (even doing cross platform compiling) its not that hard to write a C++ program for an embedded system.Originally Posted by bithub
> I have heard that C++ is almost a superset of C.
C++ is a semantic superset of C (all the concepts of C are also in C++).
C++ is not however a syntactic superset of C. Not all valid C programs can be compiled as C++, and not all valid C programs which can be compiled with C++ will produce identical results.
http://david.tribble.com/text/cdiffs.htm
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.