C: When to use C v. C++

You pick C when

  • you need portable assembler (which is what C is, really) for whatever reason,
  • your platform doesn’t provide C++ (a C compiler is much easier to implement),
  • you need to interact with other languages that can only interact with C (usually the lowest common denominator on any platform) and your code consists of little more than the interface, not making it worth to lay a C interface over C++ code,
  • you hack in an Open Source project (many of which, for various reasons, stick to C),
  • you don’t know C++.

In all other cases you should pick C++.




Stackoverflow Solutions

Just started! Have not answered any questions.