Which is faster between C and C++? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 4

Which is faster between C and C++?

27th Jan 2018, 12:24 PM
Gaurav Jaiswal
Gaurav Jaiswal - avatar
4 Antworten
+ 10
Just because C++ is higher level than C doesn't make it slower. In fact, C++ was designed to be faster (if not just as fast as) C. There are a few cases and arguments which may benefit your evaluation: https://www.quora.com/Is-C++-slower-than-C-If-yes-is-the-difference-significant
27th Jan 2018, 1:35 PM
Hatsy Rei
Hatsy Rei - avatar
+ 9
In my opinion, C would have a bit faster. Because it have less function than C++.
27th Jan 2018, 12:43 PM
Tran Huu Dang
Tran Huu Dang - avatar
+ 2
Both have the same speed.
27th Jan 2018, 12:43 PM
Abdullah Omar Nasseef
Abdullah Omar Nasseef - avatar
+ 2
Their speed is quite similar *but* using C++ classes and other object-oriented features is slower than C. If you're going to only use normal types, functions, C-style arrays, the C standard library etc. (basically if you're going to write code that's valid in both languages, which most C code is) compiling it using a C compiler will make it faster (though not by much) and make the executable smaller.
27th Jan 2018, 1:06 PM
Vlad Serbu
Vlad Serbu - avatar