is C really more low level than C++

So I've been learning how to program on and off for about 3 years now,

I first started with Java, I then changed to C++ as my overall goal was to learn how computers work at a lower level, recently I have encountered a few comments that implied C is lower level than C++ and if one wants to get a better understanding of how their underlying systems work they should use C rather than C++,

but isn't it true you can pretty much do everything in C++ that you can do in C, I wouldn't go as far to say C++ is a superset of C but it's close to it

so why would C be lower level if you can pretty much do everything you could in C with C++?
C is not “lower level” than C++.

However, it is significantly smaller, and the C Standard Library lacks a lot of the higher-level constructs that C++ provides, like containers and algorithms.

Also, C++ is a superset of C — by design.
There are incompatibilities between the two languages, but by and large you should be able, with minimal refactoring, to compile a C program with a C++ compiler. If you wish to learn more, the following link is a very old one, but it is still a good one: http://david.tribble.com/text/cdiffs.htm

[edit] Fixed typo
Last edited on
I would argue that C++ is capable of higher-level abstractions than C, while being capable of equally-low-level abstractions as C.
C is not “lower level” than C++.
Correct weight!

"A low-level programming language is a programming language that provides little or no abstraction from a computer's instruction set architecture."

So, C and C++ are both high level languages. The differences are far too complex, (or far too simple, if you like!) to make a bold statement that one is higher than the other on some fictitious perch or level.

http://www.stroustrup.com/bs_faq.html#difference




C is actually lower level. Reason is especially the destructor and virtual functions. Besides the convenient stuff like operators.
closed account (2z0kLyTq)
When you say low level what do you mean?

Does lower level imply that the code we write in C is easier to map to machine code than the code written in C++?

You can develop drivers with C++, that's enough low level compared to C which is also used for that job.

anything you can do in C you can also in C++, meaning that also makes C++ enough low level if needed compared to C.

well only assembly is more low leven than both C or C++. and compared to assembly both C and C++ are high level.

C++ is C on steroids, the biggest difference between them is that C++ is object oriented language while C is not, but that doesn't mean you need to use object oriented approach, you can as well write procedural code with C++, which is default for C.

all that said C++ does all the job that C does. so no C is not more low level in any way, it's only inferior.

but that doesn't mean C can't do the same thing as C++, it's only that code will be written in much different way, and likely in more hard/cumbersome way.

helios wrote:
I would argue that C++ is capable of higher-level abstractions than C, while being capable of equally-low-level abstractions as C.

exactly!, accurate and to the point.
Last edited on
Vote to close because this topic gets primarily opinion-based answers.
C and C++ are virtually identical in their ability to do low level coding.
modern c++ frowns upon some of these techniques, but the language and compilers and all do still support these language features.

C is unable to do the higher level things, though.

That makes c++ still the #1 best hybrid language that spans everything from near assembly level to advanced high level.
Topic archived. No new replies allowed.