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++.

Top answer
1 of 12
185

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++.

2 of 12
88

There are a few reasons to prefer C. The main one is that it tends to be more difficult to produce truly tiny executables with C++. For really small systems, you're rarely writing a lot of code anyway, and the extra ROM space that would be needed for C++ rather than C can be significant.

I should also add, however, that for really tiny systems, C has problems for exactly the same reason, and assembly language is nearly the only reasonable choice. The range of system sizes within which C really makes sense is quite small, and shrinking constantly (though I'll admit, fairly slowly).

Another time/reason to use C is to provide a set of functions that you can bind to from essentially any other language. You can write these functions in C++ by defining them as extern "C" functions, but doing so restricts those functions to presenting an essentially C-life "face" to the world -- classes, overloaded functions, templates, and member functions, etc., need not apply. This doesn't necessarily restrict development to C though -- it's perfectly reasonable to use any and all manner of C++ features internally, as long as the external interface looks like C.

At the same time, I have to say that @Toll's answers (for one obvious example) have things just about backwards in most respects. Reasonably written C++ will generally be at least as fast as C, and often at least a little faster. Readability is generally much better, if only because you don't get buried in an avalanche of all the code for even the most trivial algorithms and data structures, all the error handling, etc.

Templates don't "fix a problem with the language's type system", they simply add a number of fundamental capabilities almost completely absent from C and/or C++ without templates. One of the original intents was to provide for type-safe containers, but in reality they go far beyond that -- essentially none of which C provides at all.

Automated tools are mostly a red herring as well -- while it's true that writing a C parser is less work than writing a C++ parser, the reality is that it makes virtually no difference in the end. Very few people are willing or able to write a usable parser for either one. As such, the reasonable starting point is Clang either way.

As it happens, C and C++ are fairly frequently used together on the same projects, maintained by the same people. This allows something that's otherwise quite rare: a study that directly, objectively compares the maintainability of code written in the two languages by people who are equally competent overall (i.e., the exact same people). At least in the linked study, one conclusion was clear and unambiguous: "We found that using C++ instead of C results in improved software quality and reduced maintenance effort..."

Discussions

Except OOP, why is C++ better than C? - Stack Overflow
Any language could be considered ... set or normal usage. ... OOP is just an idea; it can be done with C (pointers to functions wrapped in macros realising this pointers as methods, pointers to other structs as inheritance, cases for polymorphism), but has a poor language support there. ... It would be better to ask what ... More on stackoverflow.com
🌐 stackoverflow.com
When is C better than C++?
Its better to write in C if you have to write in C due to external constraints. Maybe your project simply is in C. Maybe you dont have a C++ compiler that is worth using. Maybe you are writing the kernel and people have an irrational bias against C++. Maybe you are reliant on a C API provided by a vendor - although that doesnt mean that your code needs to be in C. Maybe all your programmers know C, but nobody has any exerpience with C++. Maybe that could be changed if you showed them the advantages of C++. Approximately 98% of all C code is valid C++ anyways. However it may not be sound to port your project to C++, because those last few cases where the languages differ may fundamentally break your code. Or maybe its just not deemed worthwhile from the start - but thats how you end up with legacy code nobody wants to touch. So if you have no constraints, I dont see any reason why you would start a new project in C instead of C++. You may also be interested in CppCon 2016: Dan Saks “extern c: Talking to C Programmers about C++” More on reddit.com
🌐 r/cpp_questions
73
45
May 23, 2023
Should I learn C before learning C++? - Stack Overflow
HOWEVER: C is not, not, NOT DEAD. People seem to grasp onto the 'there's no need to learn both' trope for dear life, but in reality this has no basis. To borrow syntax originating from C, C++ != C. Knowing C++ will NOT make you a qualified C developer, and likewise, knowing C will NOT make you a qualified C++ developer. ... THAT SAID: There's NO harm in taking on C before delving into C++ - The more you know, the better ... More on stackoverflow.com
🌐 stackoverflow.com
Might be a dumb question, but does C or better include C-?
🌐 r/college
13
12
December 22, 2021
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › difference-between-c-and-c
Difference between C and C++ - GeeksforGeeks
C++ is often viewed as a superset of C. C++ is also known as a "C with class" This was very nearly true when C++ was originally created, but the two languages have evolved over time with C picking up a number of features that either weren't ...
Published   July 11, 2025
🌐
Quora
quora.com › Between-C-and-C-which-one-is-better-to-learn-first-and-why-so
Between C and C++, which one is better to learn first and why so? - Quora
Answer (1 of 2): First off, don’t learn C first if your intention is to learn C++. If you learn C they will teach you about pointers and C style arrays and null terminated char arrays as strings and how an array usually decays to a pointer to it’s first element and how pointers to arrays are spec...
🌐
YouTube
youtube.com › watch
C vs C++ | Which Should you Learn? - YouTube
Start your software dev career - https://calcur.tech/dev-fundamentals Be notified of new C/C++ course: https://calcur.tech/c-cpp-newsletter💯 FREE Courses (1...
Published   March 27, 2023
🌐
Medium
imaaduddinn.medium.com › c-vs-c-which-one-should-you-learn-3a0bbcddbe7b
C vs C++ | Which One Should You Learn? | by Imaad Uddin | Medium
May 1, 2024 - To determine which language is best for you, it is important to understand the differences between C and C++. The primary difference between the two languages is that C is a procedural language, while C++ is an object-oriented language.
Find elsewhere
🌐
DEV Community
dev.to › swordheath › what-to-choose-c-vs-c-1j8e
What to choose: C vs C++? - DEV Community
March 24, 2023 - Intermediate Grade on Computer ... a bit of law, economics and design ... "Well written code in any language is always better than poorly written code in any other language."...
🌐
Codedamn
codedamn.com › news › c programming
C VS C++ – Which one should you learn and why?
January 15, 2023 - Ultimately, the choice between C and C++ depends on your goals and needs as a programmer. C may be the better choice if you are interested in low-level programming tasks, while C++ is better suited for higher-level applications.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › difference between c and c++
Difference between C and C++
November 5, 2024 - C++ is an extension of the C language along with Object-Oriented Programming language (OOPs) that gives the advantage of security, better performance, speed, scalability, built-in library, and many more.
🌐
Quora
quora.com › Which-is-better-C-or-C++
Which is better: C or C++? - Quora
Answer (1 of 265): TL;DR - One thing I don’t see mentioned in the existing answers is that C++ is basically a whole program compiler and is not suited to build upgradable shared libraries, whereas C is used for nearly all low-level upgradable shared libraries.
🌐
YouTube
youtube.com › shorts › NJB7IvQvYtg
C vs C++ | Which Should you Learn? #coding #c #software - YouTube
Start your software dev career - https://calcur.tech/dev-fundamentals
Published   April 1, 2023
🌐
Udacity
udacity.com › blog › 2021 › 05 › should-i-learn-c-or-cpp.html
Should I Learn C or C++? | Udacity
September 27, 2022 - If you’re working with complex software, C++ is a better fit because you have more libraries to rely on. Thinking practically, having knowledge of C++ is often a requirement for a variety of programming roles. Think of all the big companies listed earlier whose platforms are based on C++! As you can see, there are cases in which either C or ...
🌐
Reddit
reddit.com › r/cpp_questions › when is c better than c++?
r/cpp_questions on Reddit: When is C better than C++?
May 23, 2023 -

A former co-worker talked about how C++ is just better than C, since it has more functionalities and if memory is an issue (like in a micro processor) you just avoid including packages and write C code in your .cpp file.

But a co-worker at my new office instead had the mentality that why should we even bother with .cpp files if we are already 99% certain we’ll need to write everything in pure C.

I understand this forum might be biased but I would still like to know your opinions on the matter. When, if ever, is it better to code in pure C instead of C++?

🌐
Indeed
indeed.com › career guide › career development › c# vs. c++: what are the differences?
C# vs. C++: What Are the Differences? | Indeed.com
December 15, 2025 - If you learn C++ as a beginner, other programming languages can be easier to understand.Related: 7 Pros and 4 Cons of Being a Programmer · C++ has better performance overall, although the true differences are minimal because of various factors.
Top answer
1 of 14
145

There is no need to learn C before learning C++.

They are different languages. It is a common misconception that C++ is in some way dependent on C and not a fully specified language on its own.

Just because C++ shares a lot of the same syntax and a lot of the same semantics, does not mean you need to learn C first.

If you learn C++ you will eventually learn most of C with some differences between the languages that you will learn over time. In fact its a very hard thing to write proper C++ because intermediate C++ programmers tend to write C/C++.That is true whether or not you started with C or started with C++.

If you know C first, then that is good plus to learning C++. You will start with knowing a chunk of the language. If you do not know C first then there is no point focusing on a different language. There are plenty of good books and tutorials available that start you from knowing nothing and will cover anything you would learn from C which applies to C++ as well.

Please see further reasoning in this answer.

2 of 14
90

I love this question - it's like asking "what should I learn first, snowboarding or skiing"? I think it depends if you want to snowboard or to ski. If you want to do both, you have to learn both.

In both sports, you slide down a hill on snow using devices that are sufficiently similar to provoke this question. However, they are also sufficiently different so that learning one does not help you much with the other. Same thing with C and C++. While they appear to be languages sufficiently similar in syntax, the mind set that you need for writing OO code vs procedural code is sufficiently different so that you pretty much have to start from the beginning, whatever language you learn second.

🌐
freeCodeCamp
freecodecamp.org › news › c-vs-cpp-whats-the-difference
C vs C++ – What's The Difference?
November 4, 2021 - Code could be abstracted and better-organized and anything could be represented using classes. The systems programming language, C, which offered the ability to get really close to the machine hardware and do demanding low level computational tasks. Those two ideas combined allowed for higher level abstraction without losing the low level efficiency of C. So, the language 'C with classes' was created. In 1984 'C with classes' was renamed to C++. So, C++ is ...
🌐
InterviewBit
interviewbit.com › compare › difference between c and c++
Difference Between C and C++ - InterviewBit
September 26, 2023 - Ans. The significant difference between C and C++ is an Object-oriented language that gives the advantages of data security, scalability, better performance, rich built-in functions and so much more.